#include <bits/stdc++.h>
using namespace std;
int week[7];
int main() {
  int n, i, sum, flag;
  while (cin >> n) {
    sum = 0;
    for (i = 0; i < 7; ++i) {
      cin >> week[i];
      sum += week[i];
    }
    for (i = 6; i > -1; --i) {
      if (week[i]) {
        flag = i;
        break;
      }
    }
    if (n > sum) n %= sum;
    if (n == 0)
      cout << flag + 1 << endl;
    else {
      for (i = 0;; ++i) {
        if (n <= week[i]) break;
        n -= week[i];
      }
      cout << i + 1 << endl;
    }
  }
}
