#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n;
long long p[200];
vector<long long> cost;
long long B;
void solve() {
  long long count = 0;
  cost.push_back(-1);
  for (int i = 1; i <= n - 1; i++) {
    if (p[i] % 2 == 0) {
      count += 1;
    } else {
      count -= 1;
    }
    if (count == 0) {
      cost.push_back(abs(p[i] - p[i + 1]));
    }
  }
  sort(cost.begin(), cost.end());
  long long sum = 0;
  long long size = cost.size();
  long long ans = 0;
  for (int i = 1; i <= size - 1; i++) {
    sum += cost[i];
    if (sum > B) break;
    ans += 1;
  }
  printf("%lld", ans);
}
int main() {
  scanf("%lld%lld", &n, &B);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &p[i]);
  }
  solve();
  return 0;
}
