#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const int INF = int(2e9) + 99;
void test_case() {
  int n, b;
  cin >> n >> b;
  vector<int> arr(n), ans;
  for (auto &x : arr) cin >> x;
  arr.push_back(-1);
  int odd = 0, even = 0, cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (arr[i] % 2)
      odd += 1;
    else
      even += 1;
    if (odd == even && odd > 0) {
      ans.push_back(abs(arr[i] - arr[i + 1]));
    }
  }
  sort(ans.begin(), ans.end());
  for (auto x : ans) {
    if (b - x >= 0) {
      cnt += 1;
      b -= x;
    }
  }
  cout << cnt << '\n';
  return;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) test_case();
  return 0;
}
