#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
static int N, M, P, val[MAXN], cut[MAXN];
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%d", &val[i]);
  for (int i = 1, odd = 0, evn = 0; i < N; i++) {
    ((val[i] & 1) ? odd : evn) += 1;
    if (odd == evn) cut[P++] = abs(val[i + 1] - val[i]);
  }
  sort(cut, cut + P);
  for (int i = 0, sum = 0; i < P; i++)
    if ((sum += cut[i]) > M) return printf("%d\n", i), 0;
  printf("%d\n", P);
  return 0;
}
