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