#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b;
  cin >> n >> b;
  vector<int> a(n), odd(n), even(n), p;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2)
      odd[i]++;
    else
      even[i]++;
    if (i != 0) {
      odd[i] += odd[i - 1];
      even[i] += even[i - 1];
    }
  }
  if (odd[n - 1] != even[n - 1])
    cout << "0";
  else {
    for (int i = 0; i < n - 1; i++) {
      if (odd[i] == even[i]) {
        p.push_back(abs(a[i + 1] - a[i]));
      }
    }
    long long sum = 0, l = 0;
    sort(p.begin(), p.end());
    for (int i = 0; i < p.size(); i++) {
      if (sum + p[i] > b) break;
      sum += p[i];
      l++;
    }
    cout << l;
  }
}
