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