#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[8], k = 0;
  cin >> n;
  for (int i = 0; i < 7; i++) cin >> a[i];
  while (n > 0) {
    n -= a[k];
    k = (k + 1) % 7;
  }
  if (k == 0)
    cout << 7;
  else
    cout << k;
  return 0;
}
