#include <bits/stdc++.h>
using namespace std;
int n, d;
int odd, even;
vector<int> answer;
int main() {
  cin >> n >> d;
  int least[n];
  for (int i = 0; i < n; i++) cin >> least[i];
  for (int i = 0; i < n - 1; i++) {
    if (least[i] % 2)
      odd++;
    else
      even++;
    if (even == odd) answer.push_back(abs(least[i] - least[i + 1]));
  }
  sort(answer.begin(), answer.end());
  int cont = 0;
  for (int i = 0; i < answer.size(); i++) {
    if (d - answer[i] >= 0) {
      cont++;
      d -= answer[i];
    } else
      break;
  }
  cout << cont << endl;
  return 0;
}
