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