#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, B, a[110], ans = 0, b[110], bcnt = 0;
int odd = 0, even = 0;
int main() {
  scanf("%d%d", &n, &B);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    if (i != 1) {
      if (odd == even) {
        b[++bcnt] = abs(a[i] - a[i - 1]);
      }
    }
    if (a[i] & 1)
      ++odd;
    else
      ++even;
  }
  sort(b + 1, b + bcnt + 1);
  for (int i = 1; i <= bcnt; ++i)
    if (B >= b[i]) {
      B -= b[i];
      ++ans;
    }
  printf("%d\n", ans);
  return 0;
}
