#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[1000];
  int n, b;
  vector<int> v;
  cin >> n >> b;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int sum = 0;
  int cuts = 0;
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] % 2 == 0) {
      cnt++;
    } else {
      cnt--;
    }
    if (cnt == 0) {
      v.push_back(abs(a[i] - a[i + 1]));
    }
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    if (v[i] + sum > b) {
      break;
    }
    sum += v[i];
    cuts++;
  }
  cout << cuts;
  return 0;
}
