#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, day[7], i;
  int finished = 0;
  cin >> n;
  for (i = 0; i < 7; ++i) cin >> day[i];
  for (i = 0; 1; i = (i + 1) % 7) {
    finished += day[i];
    if (finished >= n) break;
  }
  cout << (i + 1) << endl;
  return 0;
}
