#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int a[7];
  for (int i = 0; i < 7; i++) {
    scanf("%d", &a[i]);
  }
  int sum = 0;
  while (n > 0) {
    n -= a[sum % 7];
    sum++;
  }
  if (sum % 7 != 0)
    printf("%d", sum % 7);
  else
    printf("7\n");
  return 0;
}
