#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  auto a = vector<int>(7);
  for (auto&& aa : a) cin >> aa;
  int p = -1;
  while (n > 0) {
    n -= a[++p % 7];
  }
  cout << (p % 7) + 1 << endl;
  return 0;
}
