#include <bits/stdc++.h>
using namespace std;
void mishraa() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  mishraa();
  int n, B;
  cin >> n >> B;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  int ev = 0, odd = 0;
  vector<int> price;
  for (int i = 0; i < n - 1; i++) {
    v[i] % 2 == 0 ? ev++ : odd++;
    if ((i != 0 && i != n - 1) && ev == odd) {
      int cost = abs(v[i] - v[i + 1]);
      ev = 0;
      odd = 0;
      price.push_back(cost);
    }
  }
  sort(price.begin(), price.end());
  int ans = 0, cut1 = 0;
  for (int i = 0; i < price.size(); i++) {
    if (ans + price[i] <= B) {
      ans += price[i];
      cut1++;
    } else {
      break;
    }
  }
  cout << cut1 << endl;
  return 0;
}
