#include <bits/stdc++.h>
using namespace std;
long long const delta = 1000000007;
int main() {
  std::ios::sync_with_stdio(0);
  ;
  cin.tie(0);
  cout.tie(0);
  long long n, b;
  cin >> n >> b;
  long long a[n];
  long long odd = 0, even = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0)
      even++;
    else
      odd++;
  }
  vector<long long> ans;
  long long temp1 = 0, temp2 = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] % 2 == 0)
      temp1++;
    else
      temp2++;
    if (temp1 == temp2 && i != n - 1) {
      ans.push_back(llabs(a[i + 1] - a[i]));
      ;
      temp1 = temp2 = 0;
    }
  }
  long long cnt = 0, sum = 0;
  sort(ans.begin(), ans.end());
  for (long long i = 0; i < ans.size(); i++) {
    sum += ans[i];
    if (sum > b) break;
    cnt++;
  }
  cout << cnt;
  return 0;
}
