#include using namespace std; int main() { int l, n, w, sum = 0; cin >> l >> n; for(int i = 0; i < n; i++) { cin >> w; sum += w; } int ans = 0, p = l; while(sum > 0) { l--; sum--; if(l == 0) { l = p; ans++; } } if(l != p && l > 0) ans++; cout << ans << endl; }