#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, sum = 0, ctr = 0;
  cin >> n;
  int A[7] = {0};
  for (int i = 0; i < 7; i++) cin >> A[i];
  int a;
s:
  a = 0;
  while (n > A[a]) {
    n -= A[a];
    a++;
    if (a == 7) goto s;
  }
  cout << a + 1;
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
