#include <bits/stdc++.h>
using namespace std;
const int maxn = 10;
int week[maxn];
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    int ans = 0;
    for (int i = 0; i < 7; i++) {
      scanf("%d", &week[i]);
    }
    int p = 0;
    while (n > 0) {
      p = p % 7;
      n -= week[p];
      ans = p;
      p++;
    }
    printf("%d\n", ans + 1);
  }
  return 0;
}
