#include <bits/stdc++.h>
using namespace std;
long long maxi = LLONG_MIN;
long long mini = LLONG_MAX;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
long long t, i, j, k, n, temp, flag, ans, m;
int main() {
  long long n, b;
  cin >> n >> b;
  vector<long long> a(n + 1, 0), o(n + 1, 0), e(n + 1, 0);
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] & 1) {
      o[i] = o[i - 1] + 1;
      e[i] = e[i - 1];
    } else {
      o[i] = o[i - 1];
      e[i] = e[i - 1] + 1;
    }
  }
  vector<long long> v;
  for (i = 1; i < n; i++) {
    if (o[i] == e[i]) {
      v.push_back(abs(a[i + 1] - a[i]));
    }
  }
  sort(v.begin(), v.end());
  long long ans = 0;
  for (i = 0; i < v.size(); i++) {
    if (b < v[i])
      break;
    else {
      ans++;
      b -= v[i];
    }
  }
  cout << ans;
  return 0;
}
