#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, s = 0, p, b;
  cin >> n >> b;
  vector<int> vc, cnt;
  for (int i = 0; i < n; i++) {
    scanf("%d", &k);
    vc.push_back(k);
  }
  bool flg = false;
  int even = 0, odd = 0;
  for (int i = 0; i <= n; i++) {
    if (i == n) {
      if (even == odd) {
        flg = true;
        break;
      }
    }
    if (vc[i] % 2 == 0)
      even++;
    else
      odd++;
    if (i != n - 1 && even == odd) {
      cnt.push_back(abs(vc[i + 1] - vc[i]));
      even = odd = 0;
    }
  }
  sort(cnt.begin(), cnt.end());
  s = 0, k = 0;
  for (int i = 0; i < cnt.size(); i++) {
    if (s + cnt[i] <= b) {
      k++, s += cnt[i];
    }
  }
  if (flg == true) {
    cout << k << endl;
  } else
    cout << 0 << endl;
}
