#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, res;
  cin >> n;
  long long a[8] = {0};
  for (long long i = 1; i <= 7; i++) cin >> a[i];
  a[8] = 0;
  long long counter = 8;
  while (n > 0) {
    counter = (counter % 8) + 1;
    n = n - a[counter];
  }
  cout << counter;
}
