#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int a[7] = {};
  int n, s, ans;
  cin >> n;
  for (int i = 0; i < 7; ++i) cin >> a[i];
  while (n > 0) {
    for (int i = 0; i < 7; ++i) {
      n = n - a[i];
      if (n <= 0) {
        ans = i + 1;
        break;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
