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