#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, bi;
  cin >> n >> bi;
  vector<long long> a(n), b(n), c(n), d;
  for (__typeof(0) i = 0; i <= n - 1; i++) {
    cin >> a[i];
    b[i] = a[i] % 2;
    if (b[i] == 0) b[i]--;
    if (i == 0)
      c[i] = b[i];
    else
      c[i] = c[i - 1] + b[i];
  }
  for (__typeof(0) i = 0; i <= n - 1; i++) {
    if (c[i] == 0 && i < n - 1) d.push_back(abs(a[i] - a[i + 1]));
  }
  sort((d).begin(), (d).end());
  long long q = 0, k = d.size();
  long long ans = 0, sum = 0;
  while (q < k) {
    sum += d[q];
    q++;
    if (sum <= bi)
      ans++;
    else
      break;
  }
  cout << ans << "\n";
  return 0;
}
