#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int pages[7];
  for (int i = 0; i < 7; i++) {
    cin >> pages[i];
  }
  int ans = 0;
  int days = 0;
  while (n > 0) {
    n -= pages[days % 7];
    days++;
  }
  cout << ((days - 1) % 7) + 1 << "\n";
}
int main() { solve(); }
