#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\n';
  err(++it, args...);
}
int get(vector<int> parity, int start, int end) {
  int n = parity.size();
  int l, r;
  if (start == 0)
    l = 0;
  else
    l = parity[start - 1];
  if (end == (n - 1))
    r = 0;
  else
    r = parity[n - 1] - parity[end];
  return parity[n - 1] - l - r;
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> arr(n);
  vector<int> parity(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  parity[0] = arr[0] % 2;
  for (int i = 1; i < n; i++) parity[i] += parity[i - 1] + arr[i] % 2;
  vector<int> costs;
  for (int i = 0; i < n - 1; i++) {
    int l = get(parity, 0, i);
    int r = get(parity, i + 1, n - 1);
    if (l == ((i + 1) / 2) && r == ((n - i - 1) / 2))
      costs.push_back(abs(arr[i + 1] - arr[i]));
  }
  sort(costs.begin(), costs.end());
  int ans = 0;
  for (auto it : costs) {
    if (k < it) break;
    ans++;
    k -= it;
  }
  cout << ans << endl;
  return 0;
}
