#include <bits/stdc++.h>
using namespace std;
int a[100 + 2], n, b;
int odd[100 + 2], even[100 + 2];
int dp[105][105][5005];
int DP(int cur, int cost, int cuts, int prev) {
  if (cost > b) return 0;
  if (cur == n) {
    if (cost <= b)
      return cuts;
    else
      return 0;
  }
  int &ret = dp[cur][cuts][cost];
  if (ret != -1) return ret;
  ret = 0;
  for (int i = cur; i < n; i += 2) {
    if (odd[i] - odd[prev] == even[i] - even[prev] &&
        even[n] - even[i] == odd[n] - odd[i] && even[n] - even[i] > 0) {
      ret = max(ret, DP(i + 1, cost + abs(a[i + 1] - a[i]), cuts + 1, i));
    }
    ret = max(ret, DP(i + 1, cost, cuts, prev));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> b;
  memset(dp, -1, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] & 1)
      odd[i] = 1;
    else
      even[i] = 1;
    odd[i] += odd[i - 1];
    even[i] += even[i - 1];
  }
  cout << DP(2, 0, 0, 0) << endl;
}
