#include <bits/stdc++.h>
const int64_t mod = 1e9 + 7;
const long long INF = 1e15;
const double PI = acos(-1);
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int64_t i = 0; i < v.size(); ++i) {
    if (i) os << ", ";
    os << v[i];
  }
  os << "]\n";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  os << "{";
  for (auto it : v) {
    os << it;
    if (it != *v.rbegin()) os << ", ";
  }
  os << "}\n";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const map<T, S>& v) {
  os << "{";
  for (auto it : v) {
    os << "(" << it.first << " : " << it.second << ")";
    if (it != *v.rbegin()) os << ", ";
  }
  os << "}\n";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  os << "(";
  os << v.first << ", " << v.second << ")";
  return os;
}
template <typename T>
inline istream& operator>>(istream& in, vector<T>& a) {
  for (auto& x : a) in >> x;
  return in;
}
int64_t fpow(int64_t x, int64_t y, int64_t p);
const int64_t mxN = 101, mxB = 101;
int64_t n, b;
int64_t a[mxN];
int64_t dp[mxN][mxB];
int64_t mxCuts(int64_t n, int64_t c) {
  if (c < 0) return INT_MIN;
  if (n == 0) return 0;
  if (dp[n][c] != -1) {
    return dp[n][c];
  }
  int64_t odd = 0, even = 0;
  dp[n][c] = 0;
  for (int64_t i = n - 1; i >= 0; --i) {
    if (a[i] & 1)
      ++odd;
    else
      ++even;
    if (odd == even)
      if (i > 0)
        dp[n][c] = max(dp[n][c], 1 + mxCuts(i, c - abs(a[i] - a[i - 1])));
  }
  return dp[n][c];
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int64_t T = 1;
  for (int64_t tc = 1; tc <= T; ++tc) {
    cin >> n >> b;
    for (int64_t i = 0; i < n; ++i) cin >> a[i];
    for (int64_t i = 0; i < mxN; ++i)
      for (int64_t j = 0; j < mxB; ++j) dp[i][j] = -1;
    cout << mxCuts(n, b) << endl;
  }
  return 0;
}
int64_t fpow(int64_t x, int64_t y, int64_t p) {
  int64_t res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
