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