#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n, b;
  cin >> n >> b;
  vector<int> a(n);
  for (int &x : a) cin >> x;
  if (n & 1) {
    cout << 0;
    return 0;
  }
  vector<int> p(n - 1, 0);
  p[0] = (a[0] & 1 ? 1 : -1);
  for (int i = 1; i < n - 1; i++) p[i] = p[i - 1] + (a[i] & 1 ? 1 : -1);
  vector<int> ans;
  for (int i = 1; i < n - 1; i++)
    if (p[i] == 0) ans.push_back(abs(a[i] - a[i + 1]));
  sort(ans.begin(), ans.end());
  int kol = 0;
  int i = 0;
  while (i < ans.size() && b - ans[i] >= 0) b -= ans[i++], kol++;
  cout << kol;
}
