#include <bits/stdc++.h>
using namespace std;
const int N = 200005, M = 100005;
const long long MOD = 1e9 + 7;
const double eps = 1e-9;
const double PI = acos(-1.0);
int n, b, a[105];
vector<int> v;
int main() {
  cin >> n >> b;
  int e = 0, o = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) {
    if (a[i] % 2 == 0)
      e++;
    else
      o++;
    if (e == o) v.push_back(abs(a[i] - a[i + 1]));
  }
  sort(v.begin(), v.end());
  int ans = 0;
  for (int i = 0; i < v.size(); i++) {
    if (v[i] <= b) {
      b -= v[i];
      ans++;
    } else
      break;
  }
  cout << ans << endl;
  return 0;
}
