#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long a[101], even[101], odd[101], n, i, j, k, ans = 0;
  vector<long long> cuts;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    even[i] = (a[i] % 2 == 0);
    odd[i] = (a[i] % 2 != 0);
  }
  for (i = 1; i < n; i++) even[i] += even[i - 1], odd[i] += odd[i - 1];
  for (i = 0; i < n - 1; i++) {
    if (even[i] == odd[i]) cuts.push_back(abs(a[i + 1] - a[i]));
  }
  sort(cuts.begin(), cuts.end());
  long long s = 0;
  for (long long x : cuts) {
    s += x;
    if (s <= k) ans++;
  }
  cout << ans;
}
