#include <bits/stdc++.h>
using namespace std;
int n, b, arr[100], even, odd, res;
vector<int> v;
int main() {
  cin >> n >> b;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (even == odd && i < n && i > 0) {
      v.push_back(abs(arr[i] - arr[i - 1]));
    }
    even += (arr[i] % 2 == 0);
    odd += (arr[i] % 2);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    if (b < v[i]) {
      return cout << res << endl, 0;
    }
    res++;
    b -= v[i];
  }
  cout << res << endl;
  return 0;
}
