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