#include <bits/stdc++.h>
using namespace std;
int n, b, odd, even, ans;
int arr[101];
void solve() {
  cin >> n >> b;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  vector<int> v;
  ans = 0;
  if (arr[0] & 1) {
    odd = 1;
    even = 0;
  } else {
    odd = 0;
    even = 1;
  }
  n--;
  for (int i = 1; i < n; i++) {
    if (arr[i] & 1)
      odd++;
    else
      even++;
    if (odd == even) {
      v.push_back(abs(arr[i + 1] - arr[i]));
    }
  }
  sort(v.begin(), v.end());
  for (int it : v) {
    if (it <= b) {
      ans++;
      b -= it;
    } else {
      break;
    }
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
}
