#include <bits/stdc++.h>
using namespace std;
int main() {
  ofstream fout("sprinklers.out");
  ifstream fin("sprinklers.in");
  int n;
  cin >> n;
  vector<int> v(7);
  for (int i = 0; i < 7; i++) {
    cin >> v[i];
  }
  int sum = 0;
  while (sum < n) {
    for (int i = 0; i < 7; i++) {
      sum += v[i];
      if (sum >= n) {
        cout << i + 1 << endl;
        break;
      }
    }
  }
  return 0;
}
