#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int week[7];
  for (int i = 0; i < 7; i++) {
    cin >> week[i];
  }
  int currCount = 0, currDay = 0;
  while (currCount < n) {
    currCount += week[currDay];
    currDay++;
    if (currDay == 7) {
      currDay = 0;
    }
  }
  if (currDay == 0) {
    cout << "7\n";
  } else {
    cout << currDay << "\n";
  }
  return 0;
}
