#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(18);
  int t;
  t = 1;
  while (t--) {
    long long int n, b;
    cin >> n >> b;
    vector<long long int> a(n);
    for (int i = 0; i < (n); i++) cin >> a[i];
    vector<long long int> c;
    int even = 0;
    for (int i = 0; i < (n); i++) {
      if (a[i] % 2 == 0)
        even++;
      else
        even--;
      if (even == 0) {
        if (i != n - 1) {
          c.push_back(abs(a[i + 1] - a[i]));
        }
      }
    }
    sort(c.begin(), c.end());
    if (c.size() == 0) {
      cout << 0 << endl;
      return 0;
    }
    int ans = 0;
    for (int i = 0; i < (c.size()); i++) {
      if (c[i] <= b) {
        ans++;
        b -= c[i];
      }
    }
    cout << ans << endl;
  }
  return 0;
}
