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