#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, B;
  cin >> n >> B;
  int a[n];
  for (long long i = (0); i < (n); i++) cin >> a[i];
  int check[n];
  check[0] = a[0] % 2 == 0 ? 1 : -1;
  for (long long i = (1); i < (n); i++) {
    check[i] = check[i - 1] + (a[i] % 2 == 0 ? 1 : -1);
  }
  vector<int> v;
  for (long long i = (0); i < (n - 1); i++) {
    if (check[i] == 0) v.push_back(abs(a[i] - a[i + 1]));
  }
  sort(v.begin(), v.end());
  int ans = 0;
  while (B > 0 && ans < v.size()) {
    if (v[ans] > B) break;
    B -= v[ans];
    ans++;
  }
  cout << ans << endl;
  return 0;
}
