#include <bits/stdc++.h>
using namespace std;
bool comp(int x, int y) { return x > y; }
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(7);
  for (int i = 0; i < 7; i++) cin >> a[i];
  int i = 0;
  while (1) {
    n -= a[i];
    if (n <= 0) {
      cout << i + 1 << endl;
      return 0;
    }
    i++;
    if (i == 7) i = 0;
  }
  return 0;
}
