#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, b;
  cin >> n >> b;
  long long p = b;
  long long ar[n];
  long long odd[n], even[n];
  long long nodd = 0, neven = 0;
  for (long long i = (long long)0; i < (long long)n; i++) {
    cin >> ar[i];
    if (ar[i] % 2 == 0) {
      ++neven;
    } else
      ++nodd;
    odd[i] = nodd;
    even[i] = neven;
  }
  long long ans = 0;
  vector<long long> v;
  if (nodd == neven && n > 1) {
    for (long long i = (long long)0; i < (long long)n - 1; i++) {
      long long oddnum = odd[n - 1] - odd[i];
      long long evennum = even[n - 1] - even[i];
      if ((odd[i] == even[i]) && (oddnum == evennum)) {
        long long cost = abs(ar[i] - ar[i + 1]);
        v.push_back(cost);
      }
    }
  }
  sort(v.begin(), v.end());
  long long j = 0, sums = 0;
  while (j < v.size()) {
    sums += v[j];
    if (sums <= b)
      ++ans;
    else
      break;
    ++j;
  }
  cout << ans << endl;
  return 0;
}
