#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  std::vector<pair<long long int, long long int>> a(n);
  std::vector<long long int> v;
  cin >> a[0].first;
  if (a[0].first % 2 == 1)
    a[0].second = -1;
  else
    a[0].second = 1;
  for (int i = 1; i < n; ++i) {
    cin >> a[i].first;
  }
  for (int i = 1; i < n - 1; ++i) {
    if (a[i].first % 2 == 1)
      a[i].second = a[i - 1].second - 1;
    else
      a[i].second = a[i - 1].second + 1;
    if (a[i].second == 0) v.push_back(fabs(a[i + 1].first - a[i].first));
  }
  sort(v.begin(), v.end());
  std::vector<long long int> b(v.size());
  partial_sum(v.begin(), v.end(), b.begin());
  long long int z = upper_bound(b.begin(), b.end(), k) - b.begin();
  cout << z << "\n";
}
