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