#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  int n, b;
  cin >> n >> b;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> vec;
  int po[n + 1], pe[n + 1];
  po[0] = pe[0] = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i - 1] % 2 == 1) {
      po[i] = po[i - 1] + 1;
      pe[i] = pe[i - 1];
    } else {
      po[i] = po[i - 1];
      pe[i] = pe[i - 1] + 1;
    }
    if (po[i] == pe[i] && i != n) {
      vec.push_back(abs(a[i] - a[i - 1]));
    }
  }
  sort(vec.begin(), vec.end());
  int count = 0, i = 0;
  while (i < vec.size() && b > 0 && b >= vec[i]) {
    count++;
    b -= vec[i];
    i++;
  }
  cout << count;
}
