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