#include <bits/stdc++.h>
using namespace std;
bool f(const pair<long long, long long> a, const pair<long long, long long> b) {
  if (a.first != b.first)
    return a.first > b.first;
  else {
    return a.second < b.second;
  }
}
int main(void) {
  vector<long long> z;
  long long i, j, n, s = 0;
  cin >> n;
  for (i = 0; i < 7; i++) {
    cin >> j;
    z.push_back(j);
    s += j;
  }
  i = 0;
  while (1) {
    if (n > z[i])
      n -= z[i];
    else {
      cout << i + 1 << endl;
      break;
    }
    i++;
    i %= 7;
  }
}
