#include <bits/stdc++.h>
using namespace std;
int n, a[10], sum, c;
int main() {
  cin >> n;
  for (int i = 0; i < 7; i++) {
    cin >> a[i];
  }
  while (sum < n) {
    sum += a[c];
    if (c == 6) {
      c = 0;
      continue;
    }
    c++;
  }
  if (c == 0)
    cout << 7 << endl;
  else
    cout << c << endl;
  return 0;
}
