#include <bits/stdc++.h>
using namespace std;
int n, B, a[105], e[105], o[105], v[105], ee, oo;
int main() {
  memset(e, 0, sizeof(e));
  memset(o, 0, sizeof(o));
  ee = 0;
  oo = 0;
  int count = 0;
  scanf("%d%d", &n, &B);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] % 2 == 0) {
      e[i] = ++ee;
      o[i] = oo;
    } else {
      e[i] = ee;
      o[i] = ++oo;
    }
  }
  int temp;
  while (temp != -1) {
    int minn = B;
    temp = -1;
    for (int i = 2; i < n - 1; i++)
      if (e[i] == o[i] && v[i] == 0) {
        if (abs(a[i] - a[i + 1]) <= minn) {
          temp = i;
          minn = abs(a[i] - a[i + 1]);
        }
      }
    if (temp != -1) {
      v[temp] = 1;
      B -= minn;
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
