#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, b;
  cin >> n >> b;
  vector<long long> arr(n);
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long count = 0;
  long long c = 0;
  vector<long long> cost;
  for (long long i = 0; i < n - 1; i++) {
    if (arr[i] % 2 == 0)
      count++;
    else
      count--;
    if (count == 0) cost.push_back(abs(arr[i] - arr[i + 1]));
  }
  sort(cost.begin(), cost.end());
  long long sumi = 0;
  for (long long i = 0; i < cost.size(); i++) {
    sumi += cost[i];
    if (sumi <= b) {
      c++;
    }
    if (sumi > b) break;
  }
  cout << c << endl;
  return 0;
}
