#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, t;
  cin >> a >> b;
  int arr[a];
  for (int i = 0; i < a; i++) cin >> arr[i];
  int even = 0, odd = 0;
  int ind[a];
  int c = 0;
  for (int i = 0; i < a; i++) {
    if (arr[i] % 2 == 0) {
      even++;
    }
    if (arr[i] % 2 != 0) {
      odd++;
    }
    if (even == odd && i != a - 1) {
      ind[c] = i;
      c++;
      even = 0;
      odd = 0;
    }
  }
  int fi = 0;
  int sum = 0;
  int s[200];
  for (int i = 0; i < c; i++) {
    s[i] = abs(arr[ind[i]] - arr[ind[i] + 1]);
  }
  int summ[c];
  sort(s, s + c);
  summ[0] = s[0];
  for (int i = 1; i < c; i++) {
    summ[i] = s[i] + summ[i - 1];
  }
  for (int i = 0; i < c; i++) {
    if (summ[i] <= b) fi++;
  }
  cout << fi;
  return 0;
}
