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