#include <bits/stdc++.h>
using namespace std;
long long power(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base);
    base = (base * base);
    exp /= 2;
  }
  return res;
}
int main() {
  long long n, b;
  cin >> n >> b;
  long long *a = new long long[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long e = 0;
  long long o = 0;
  vector<long long> c;
  for (long long i = 0; i < n; i++) {
    if (a[i] % 2 == 0) {
      e++;
    } else {
      o++;
    }
    if (e == o) {
      if (i != n - 1) {
        c.push_back(i);
        e = 0;
        o = 0;
      }
    }
  }
  vector<long long> d;
  for (long long i = 0; i < c.size(); i++) {
    d.push_back(abs(a[c[i]] - a[c[i] + 1]));
  }
  long long cnt = 0;
  sort(d.begin(), d.end());
  for (long long i = 0; i < d.size(); i++) {
    if (b - d[i] >= 0) {
      b = b - d[i];
      cnt++;
    }
  }
  cout << cnt << "\n";
  delete[] a;
  return 0;
}
