#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 3050 + 7;
const long long MOD = 1e9 + 7;
int a[MAXN], b[MAXN];
int main() {
  int n, sum = 0, min1 = 0X3f3f3f3f, ji = 0, ou = 0, cnt = 0;
  scanf("%d %d", &n, &min1);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] & 1) {
      ji++;
    } else
      ou++;
    if (ji == ou && i != n) b[++cnt] = abs(a[i + 1] - a[i]);
  }
  sort(b + 1, b + 1 + cnt);
  int ans = 0;
  for (int i = 1; i <= cnt; i++) {
    if (sum + b[i] > min1) {
      break;
    }
    sum += b[i];
    ans = i;
  }
  printf("%d\n", ans);
}
