#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  int n = v.size();
  for (int i = 0; i < n; i++) is >> v[i];
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  int n = v.size();
  for (int i = 0; i < n; i++) os << v[i] << " ";
  os << "\n";
  return os;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, b;
  cin >> n >> b;
  vector<long long> v(n), cuts;
  cin >> v;
  long long overeven = 0;
  for (long long i = 0; i < n - 1; ++i) {
    overeven -= ((v[i] & 1) << 1) - 1;
    if (!overeven) {
      cuts.push_back(abs(v[i + 1] - v[i]));
    }
  }
  sort(cuts.begin(), cuts.end());
  long long ans = 0;
  for (auto i : cuts) {
    if (i > b) break;
    ++ans;
    b -= i;
  }
  cout << ans << "\n";
  return 0;
}
