#include <bits/stdc++.h>
int main() {
  int n, i, count = 0, sum = 0, t, d = 0;
  scanf("%d", &n);
  scanf("%d", &t);
  int c = t;
  int a[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    if ((86400 - a[i]) < c) {
      count++;
      d = d + (86400 - a[i]);
      if (d >= t) break;
    }
    if ((86400 - a[i]) >= c) {
      count++;
      break;
    }
  }
  printf("%d", count);
  return 0;
}
