#include <bits/stdc++.h>
const unsigned int M = 1000000007;
using namespace std;
int main() {
  int pages, ans = 0, count = 0;
  int days[7];
  cin >> pages;
  for (int x = 0; x < 7; x++) cin >> days[x];
  while (true) {
    count += days[ans];
    if (count >= pages) {
      cout << ans + 1 << endl;
      break;
    }
    ans++;
    if (ans == 7) ans = 0;
  }
  return 0;
}
