#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int t, n, a[100001], b;
  priority_queue<long long int, vector<long long int>, greater<long long int> >
      lpq;
  long long int odd = 0, even = 0, ans = 0;
  cin >> n >> b;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n - 1; i++) {
    if (a[i] % 2 == 0)
      even++;
    else
      odd++;
    if (odd == even) lpq.push(abs(a[i] - a[i + 1]));
  }
  while (!lpq.empty()) {
    if (lpq.top() <= b) {
      ans++;
      b = b - lpq.top();
      lpq.pop();
    } else
      break;
  }
  cout << ans << endl;
  return 0;
}
