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