#include <bits/stdc++.h>
using namespace std;
int a[10000];
int main() {
  int n, b;
  vector<int> cc;
  cin >> n >> b;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int count1 = 0, count0 = 0;
  for (int i = 1; i <= n - 1; i++) {
    if (a[i] & 1)
      count1++;
    else
      count0++;
    if (count0 == count1 && count0 != 0) {
      cc.push_back(abs(a[i + 1] - a[i]));
    }
  }
  sort(cc.begin(), cc.end());
  int count = 0;
  for (auto a : cc) {
    if (b >= a) {
      b -= a;
      count++;
    }
  }
  cout << count << endl;
}
