#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, b, odd = 0, even = 0;
  cin >> n >> b;
  vector<long long int> v, ot;
  for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
    int asd;
    cin >> asd;
    ot.push_back(asd);
  }
  ot.push_back(ot[(ot).size() - 1]);
  for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
    int num = ot[i];
    if (num % 2 == 0)
      even++;
    else
      odd++;
    if (even == odd) v.push_back(abs(ot[i] - ot[i + 1]));
  }
  sort((v).begin(), (v).end());
  int cont = 0, sum = 0;
  for (long long int i = (long long int)(0); i < (long long int)((v).size());
       i++) {
    sum += v[i];
    if (sum <= b) cont++;
  }
  cout << cont - 1;
  return 0;
}
