#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, B;
  cin >> n >> B;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int i = 0, count = 0;
  vector<int> cut;
  for (; i < n - 1; i++) {
    if (a[i] % 2 == 0)
      count++;
    else {
      count--;
    }
    if (count == 0) {
      cut.push_back(abs(a[i + 1] - a[i]));
    }
  }
  sort(cut.begin(), cut.end());
  count = 0;
  for (int i = 0; i < cut.size(); i++) {
    if ((B - cut.at(i)) >= 0) {
      B = B - cut.at(i);
      count++;
    } else {
      break;
    }
  }
  cout << count;
  return 0;
}
