#include <bits/stdc++.h>
using namespace std;
void cmax(int &a, int b) {
  if (a < b) a = b;
}
void cmin(int &a, int b) {
  if (a > b) a = b;
}
int re() {
  char ch = getchar();
  int f = 1, ret = 0;
  while (ch < '0' || '9' < ch) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return f * ret;
}
int a[110];
int b[110];
int main() {
  int n = re(), m = re();
  for (int i = 0; i < n; i++) a[i] = re();
  int gay = 0, ou = 0;
  int top = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] & 1)
      gay++;
    else
      ou++;
    if (gay == ou) b[top++] = abs(a[i + 1] - a[i]);
  }
  sort(b, b + top);
  int ans = 0;
  int i = 0;
  while (b[i] <= m && i < top) {
    m -= b[i++];
    ans++;
  }
  cout << ans << endl;
  return 0;
}
