#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define int ll
#define endl '\n'
#define vll vector<ll>
#define input(arr) \
    for (auto& i : arr) cin >> i
#define print(arr) \
    for (auto& i : arr) cout << i << ' '; cout << '\n'
#define INF LLONG_MAX
#define YARAB_ACCEPT ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);

ll dx[] = {0, 0, -1, 1, 1, 1, -1, -1};
ll dy[] = {-1, 1, 0, 0, -1, 1, -1, 1};
const ll N = 1e5 + 5;

void solve() {
    ll n, t; cin >> n >> t;
    vll L, R;
    bool has_zero = 0;

    for (ll i = 0; i < n; ++i) {
        ll x; cin >> x;
        if (!x) {
            has_zero = 1;
            continue;
        }

        (x < 0? L.push_back(-x) : R.push_back(x));
    }

    sort(L.begin(), L.end());
    sort(R.begin(), R.end());

    ll ans = 0;

    for (ll i = 0; i <= L.size(); ++i) {
        ll dist_left = (i == 0? 0 : L[i - 1]);
        if (dist_left > t) break;

        ll time_to_origin = t - 2 * dist_left;
        ll dist_right = 0;
        if (time_to_origin > 0) {
            dist_right = upper_bound(R.begin(), R.end(), time_to_origin) - R.begin();
        }

        ans = max(ans, i + dist_right);
    }

    for (ll i = 0; i <= R.size(); ++i) {
        ll dist_right = (i == 0? 0 : R[i - 1]);
        if (dist_right > t) break;

        ll time_to_origin = t - 2 * dist_right;
        ll dist_left = 0;
        if (time_to_origin > 0) {
            dist_left = upper_bound(L.begin(), L.end(), time_to_origin) - L.begin();
        }

        ans = max(ans, i + dist_left);
    }

    cout << (has_zero? ans + 1 : ans) << '\n';
}

signed main() {
    YARAB_ACCEPT
    ll t = 1;
    // cin >> t;
    while (t--)
        solve();

    return 0;
}