#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, b, a[100];
  cin >> n >> b;
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long e = 0, o = 0;
  vector<long long> v;
  for (long long i = 0; i < n - 1; i++) {
    if (a[i] & 1)
      o++;
    else
      e++;
    if (o == e) v.push_back(abs(a[i] - a[i + 1]));
  }
  sort(v.begin(), v.end());
  long long s = 0, cnt = 0;
  for (auto i : v) {
    s += i;
    if (s <= b) {
      cnt++;
    } else
      break;
  }
  cout << cnt;
  return 0;
}
