#include <bits/stdc++.h>
using namespace std;
long long add(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  return (a + b) % 1000000007;
}
long long mul(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  return (a * b) % 1000000007;
}
int main() {
  int n, b;
  cin >> n >> b;
  int a[107];
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int odd[107];
  int even[107];
  odd[0] = 0;
  even[0] = 0;
  for (int i = 1; i <= n; ++i) {
    odd[i] = odd[i - 1];
    even[i] = even[i - 1];
    if (a[i] % 2 == 1)
      odd[i]++;
    else
      even[i]++;
  }
  vector<int> d;
  d.clear();
  for (int i = 2; i < n; ++i) {
    if (odd[i] == even[i]) {
      d.push_back(abs(a[i + 1] - a[i]));
    }
  }
  sort(d.begin(), d.end());
  int cnt = 0;
  int cost = 0;
  while (cnt < d.size() && cost + d[cnt] <= b) {
    cost += d[cnt];
    ++cnt;
  }
  cout << cnt << "\n";
  return 0;
}
