#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, page;
  cin >> n;
  vector<int> pages(7);
  for (int i = 0; i < 7; i++) {
    cin >> page;
    pages[i] = page;
  }
  int ans = 0;
  while (true) {
    n -= pages[ans];
    if (n <= 0) {
      break;
    }
    ans = (ans + 1) % 7;
  }
  cout << ans + 1;
}
