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