#include <bits/stdc++.h>
using namespace std;
const int N = 20005;
int main() {
  int n, a[8], sum = 0;
  scanf("%d", &n);
  for (int i = 0; i < 7; i++) {
    scanf("%d", &a[i]);
  }
  int count = 0;
  while (sum < n) {
    count = count % 7;
    sum += a[count];
    count++;
  }
  printf("%d\n", count);
  return 0;
}
