#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, i;
  cin >> a >> b;
  int arr[a + 1];
  for (i = 1; i <= a; i++) cin >> arr[i];
  for (i = 1; i <= a; i++) {
    b -= (86400 - arr[i]);
    if (b <= 0) break;
  }
  cout << i << endl;
}
