#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  int a[7];
  for (int i = 0; i < 7; i++) cin >> a[i];
  int cnt = 0;
  int c = 0, f = 0;
  while (cnt < n && f == 0) {
    for (int i = 0; i < 7; i++) {
      cnt += a[i];
      if (cnt >= n) {
        c = i;
        f = 1;
        break;
      }
    }
  }
  cout << c + 1 << endl;
}
