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