#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 2;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, a[N];
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int f[N] = {};
  int u = 0;
  int c = 0;
  for (int i = 1; i <= n - 2; i++) {
    if (a[i] % 2 == 0)
      ++c;
    else
      --c;
    if (c == 0) f[++u] = abs(a[i + 1] - a[i]);
  }
  int ans = 0;
  sort(f + 1, f + 1 + u);
  for (int i = 1; i <= u; i++) {
    if (k < f[i]) break;
    k -= f[i];
    ++ans;
  }
  cout << ans;
}
