#include <bits/stdc++.h>
using namespace std;
const string FILENAME = "";
const bool FILE_IO = 1;
void init() {
  if (!FILENAME.empty()) {
    freopen((FILENAME + ".in").c_str(), "r", stdin);
    freopen((FILENAME + ".out").c_str(), "w", stdout);
  }
}
int main() {
  init();
  int n, t, day = 0;
  const int x = 86400;
  cin >> n >> t;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = x - a[i];
  }
  for (int i = 0; i < n && t > 0; i++) {
    t -= a[i];
    day++;
  }
  if (t <= 0)
    cout << day;
  else
    cout << 0;
  return 0;
}
