#include <bits/stdc++.h>
using namespace std;
int a[200];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, b;
  cin >> n >> b;
  int bal = 0, cnt = 0, pre;
  vector<int> v;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) {
    if (a[i] & 1)
      bal--;
    else
      bal++;
    if (!bal) v.push_back(abs(a[i] - a[i + 1]));
  }
  sort(v.begin(), v.end());
  int ans = 0, sum = 0;
  while (ans < v.size()) {
    sum += v[ans];
    if (sum > b) break;
    ans++;
  }
  cout << ans;
}
