#include <bits/stdc++.h>
using namespace std;
const int maxn = 1 << 7;
const int M = 86400;
int main() {
  int n, t;
  cin >> n >> t;
  int a[maxn];
  for (int i = 0; i < n; i++) cin >> a[i];
  int N = 0;
  for (; N < n && t > 0; N++) t -= (M - a[N]);
  printf("%d\n", N);
}
