#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, k, i, even = 0, odd = 0;
  vector<long long int> v;
  cin >> n >> k;
  long long int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    if (a[i] % 2 == 0)
      even++;
    else
      odd++;
    if (even == odd && i != (n - 1)) {
      v.push_back(abs(a[i] - a[i + 1]));
    }
  }
  if (v.size() == 0)
    cout << "0" << endl;
  else {
    sort(v.begin(), v.end());
    long long int ans = 0;
    long long int flag = 0;
    long long int sum = 0;
    for (i = 0; i < v.size(); i++) {
      sum += v[i];
      if (sum > k) {
        cout << ans << endl;
        flag = 1;
        break;
      }
      ans++;
    }
    if (flag == 0) {
      cout << v.size() << endl;
    }
  }
  return 0;
}
