#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n, b, ans = 0, x = 0, y = 0, z = 0, c = 0;
  cin >> n >> b;
  int arr[n + 1];
  arr[n] = 0;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  for (int i = 0; i < n; ++i) {
    ((arr[i] & 1) ? ++x : ++y);
    if (x == y && arr[i + 1] != 0) {
      z = abs(arr[i] - arr[i + 1]);
      v.push_back(z);
    }
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); ++i) {
    if ((ans + v[i]) <= b) {
      ans += v[i];
      ++c;
    }
  }
  cout << c;
  return 0;
}
