#include <bits/stdc++.h>
using namespace std;
int N, B;
int a[106];
int altertive[106];
int main() {
  cin >> N >> B;
  for (int i = 1; i <= N; i++) cin >> a[i];
  memset(altertive, 0, sizeof(altertive));
  int bias = 0;
  for (int i = 1; i < N; i++) {
    if (a[i] & 1)
      bias++;
    else
      bias--;
    if (bias == 0) altertive[++altertive[0]] = abs(a[i] - a[i + 1]);
  }
  sort(altertive + 1, altertive + altertive[0] + 1);
  int cur = 0;
  for (int i = 1; i <= altertive[0]; i++) {
    if (B >= altertive[i]) {
      cur++;
      B -= altertive[i];
    } else
      break;
  }
  printf("%d\n", cur);
  return 0;
}
