#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const double eps = 1e-6;
const double pi = acos(-1);
const int inf = 0x3f3f3f3f;
using namespace std;
const int __ = 50005;
int main() {
  int n, t;
  scanf("%d%d", &n, &t);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if (x != 86400) {
      t -= 86400 - x;
      if (t <= 0) return 0 * printf("%d\n", i);
    }
  }
  return 0;
}
