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