#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b;
  scanf("%d", &n);
  scanf("%d", &b);
  vector<int> v;
  vector<int> dif;
  for (int i = 0; i < n; i++) {
    int y;
    cin >> y;
    v.push_back(y);
  }
  int e = 0, o = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0 && i > 0) {
      if (e == o) dif.push_back(abs(v[i] - v[i - 1]));
    }
    if (v[i] % 2 == 0)
      e++;
    else
      o++;
  }
  sort(dif.begin(), dif.end());
  int c = 0, s = 0;
  for (int i = 0; i < dif.size(); i++) {
    if (s + dif[i] <= b) {
      c++;
      s = s + dif[i];
    } else
      break;
  }
  cout << c << endl;
  return 0;
}
