#include <bits/stdc++.h>
using namespace std;
template <typename T>
using maxpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using minpq = priority_queue<T>;
int main() {
  clock_t clk = clock();
  cerr << "I will return...\n";
  int n, b;
  cin >> n >> b;
  vector<int> cost;
  int a[n], c[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    c[i] = a[i] % 2 ? 1 : -1;
    if (i) c[i] += c[i - 1];
    if (i != n - 1 && c[i] == 0) {
      cost.push_back(i);
    }
  }
  for (int& i : cost) {
    i = abs(a[i] - a[i + 1]);
  }
  sort((cost).begin(), (cost).end());
  int ans = 0, i = 0;
  while (b > 0 && i != cost.size()) {
    b -= cost[i++];
    ans++;
  }
  ans -= b < 0;
  cout << ans << '\n';
  cerr << "...don't you ever hang your head.\n";
  cerr << "Time (in ms): " << double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC
       << '\n';
}
