#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum = 0, n, b;
  int x = 0, y = 0, j = 0, k = 0;
  vector<int> c;
  vector<int> d;
  cin >> n >> b;
  int a[n + 1];
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) d.push_back(a[i]);
  for (auto it = d.begin(); it != d.end(); it++) {
    if (*it % 2 == 0)
      j++;
    else
      k++;
    if (j == k && it != d.end() - 1) {
      c.push_back(fabs(*(it + 1) - *it));
      j = 0;
      k = 0;
    }
  }
  if (c.empty())
    cout << 0 << endl;
  else {
    sort(c.begin(), c.end());
    for (auto it = c.begin(); it != c.end(); it++) {
      x += *it;
      if (x > b) {
        break;
      } else
        y++;
    }
    cout << y << endl;
  }
  return 0;
}
