#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int e = 0;
  int o = 0;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    if (arr[i] % 2 == 0) {
      e++;
    } else {
      o++;
    }
    if (i == n - 1) {
      continue;
    }
    if (e == o) {
      int diff = abs(arr[i] - arr[i + 1]);
      v.push_back(diff);
      e = 0;
      o = 0;
    }
  }
  sort(v.begin(), v.end());
  int ans = 0;
  for (int i = 0; i < v.size(); i++) {
    if (k >= v[i]) {
      k -= v[i];
      ans++;
    } else {
      break;
    }
  }
  cout << ans << endl;
}
