#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b;
  cin >> n >> b;
  vector<int> a(n);
  for (auto &i : a) cin >> i;
  int eq = 0;
  int last = 0;
  vector<int> cuts;
  for (int i = 0; i < n; i++) {
    if (a[i] % 2 == 0)
      eq++;
    else
      eq--;
    if (eq == 0 && i < n - 1) {
      cuts.push_back(abs(a[i] - a[i + 1]));
      last = i;
    }
  }
  sort(cuts.begin(), cuts.end());
  int count = 0;
  for (auto i : cuts) {
    if (b >= i) {
      count++;
      b -= i;
    } else
      break;
  }
  cout << count << endl;
  return 0;
}
