#include <bits/stdc++.h>
using namespace std;
int a[105];
int bits[105];
bool cmp(int x, int y) { return x > y; }
int main() {
  int n;
  int b;
  scanf("%d%d", &n, &b);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int sum1 = 0;
  int sum2 = 0;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 0) {
      sum1++;
    } else {
      sum2++;
    }
    if (sum1 == sum2 && i != n) {
      bits[++ans] = abs(a[i] - a[i + 1]);
    }
  }
  sort(bits + 1, bits + 1 + ans);
  int sum = 0;
  int c = 0;
  while (sum <= b && c <= ans) {
    sum += bits[++c];
  }
  if (c != 0) c--;
  printf("%d\n", c);
}
