#include <bits/stdc++.h>
using namespace std;
int b[8];
int main() {
  int n;
  cin >> n;
  int point = 0;
  for (int i = 1; i <= 7; ++i) {
    cin >> b[i];
  }
  while (1) {
    ++point;
    if (point == 8) point = 1;
    n -= b[point];
    if (n <= 0) {
      cout << point << endl;
      break;
    }
  }
  return 0;
}
