#include <bits/stdc++.h>
using namespace std;
const int MAXN = 412345;
const int MAXINT = 2047483098;
const long long int MOD = 1e9 + 7;
const int MAX = 1e4;
const long double pi = 2 * acosl(0);
const long double EPS = 1e-10;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPrime(long long unsigned n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int nCr(int n, int r) {
  int res = 1;
  if (n < r) return -1;
  r = min(r, n - r);
  for (long long unsigned int i = 0; i < r; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
int nPr(int n, int r) {
  int res = 1;
  if (n < r) return -1;
  for (long long unsigned int i = 0; i < r; i++) res *= (n - i);
  return res;
}
long long int fact(long long int n) {
  if (n == 1 || n == 0)
    return 1;
  else
    return (n % MOD) * fact(n - 1) % MOD;
}
void eraseSubStr(std::string& mainStr, const std::string& toErase) {
  size_t pos = mainStr.find(toErase);
  if (pos != std::string::npos) {
    mainStr.erase(pos, toErase.length());
  }
}
void eraseAllSubStr(std::string& mainStr, const std::string& toErase) {
  size_t pos = std::string::npos;
  while ((pos = mainStr.find(toErase)) != std::string::npos) {
    mainStr.erase(pos, toErase.length());
    mainStr.insert(pos, " ");
  }
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  long long int arr[n];
  bool brr[n];
  long long int o = 0, e = 0;
  for (long long unsigned int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] % 2 == 0)
      e++;
    else
      o++;
    if (e == o)
      brr[i] = true;
    else
      brr[i] = false;
  }
  long long int c = 0;
  vector<long long int> v;
  for (long long unsigned int i = 0; i < n - 1; i++) {
    if (brr[i] == true) {
      v.push_back(abs(arr[i] - arr[i + 1]));
    }
  }
  sort(v.begin(), v.end());
  long long int p = 0;
  for (long long unsigned int i = 0; i < v.size(); i++) {
    if (m - v[i] >= 0) {
      p++;
      m -= v[i];
    } else
      break;
  }
  cout << p << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T;
  T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
