#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 2e5 + 5;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  int arr[7];
  for (int i = 0; i < 7; i++) {
    cin >> arr[i];
  }
  while (n > 0) {
    if (n - arr[0] > 0) {
      n -= arr[0];
    } else {
      cout << 1;
      break;
    }
    if (n - arr[1] > 0) {
      n -= arr[1];
    } else {
      cout << 2;
      break;
    }
    if (n - arr[2] > 0) {
      n -= arr[2];
    } else {
      cout << 3;
      break;
    }
    if (n - arr[3] > 0) {
      n -= arr[3];
    } else {
      cout << 4;
      break;
    }
    if (n - arr[4] > 0) {
      n -= arr[4];
    } else {
      cout << 5;
      break;
    }
    if (n - arr[5] > 0) {
      n -= arr[5];
    } else {
      cout << 6;
      break;
    }
    if (n - arr[6] > 0) {
      n -= arr[6];
    } else {
      cout << 7;
      break;
    }
  }
}
