#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[200], use[200];
bool check(int x, int y) {
  int p = 0, q = 0;
  for (int i = 1; i <= x; i++) {
    if (a[i] % 2)
      p++;
    else
      q++;
  }
  if (p != q) return false;
  for (int i = y; i <= n; i++) {
    if (a[i] % 2)
      p++;
    else
      q++;
  }
  if (p != q) return false;
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int cnt = 0;
  for (int i = 2; i < n - 1; i++)
    if (check(i, i + 1) && abs(a[i] - a[i + 1]) <= m)
      use[++cnt] = abs(a[i] - a[i + 1]);
  if (cnt == 0) {
    cout << 0 << endl;
    return 0;
  }
  sort(use + 1, use + cnt + 1);
  int tp = 0;
  int t = 0;
  for (int i = 1; i <= cnt; i++) {
    if (tp + use[i] > m) break;
    tp += use[i];
    t++;
  }
  cout << t << endl;
  return 0;
}
