#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  vector<int> a(7);
  for (int i = 0; i < 7; i++) cin >> a[i];
  int sum = 0;
  int k = 0;
  while (sum < n) {
    sum += a[k++ % 7];
  }
  cout << (k - 1) % 7 + 1 << endl;
  return 0;
}
