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