#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int N = 100;
int n, b, a[N];
bool mark[N + 1];
bool check(int id) {
  int c[] = {0, 0};
  for (int i = id - 1; !mark[i]; i--) {
    c[a[i] & 1]++;
    if (mark[i - 1]) {
      c[a[i - 1] & 1]++;
    }
  }
  if (c[0] != c[1]) {
    return false;
  }
  c[0] = c[1] = 0;
  for (int i = id; !mark[i]; i++) {
    c[a[i] & 1]++;
  }
  return c[0] == c[1];
}
int main() {
  cin >> n >> b;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  mark[0] = mark[n] = true;
  int s = 0;
  for (int k = 0;; k++) {
    int id = -1;
    int mn = INF;
    for (int i = 2; i + 1 < n; i++) {
      if (!mark[i - 1] && !mark[i] && !mark[i + 1] &&
          abs(a[i - 1] - a[i]) < mn && check(i)) {
        mn = abs(a[i - 1] - a[i]);
        id = i;
      }
    }
    if (id == -1 || s + mn > b) {
      cout << k << '\n';
      return 0;
    }
    s += mn;
    mark[id] = true;
  }
  return 1;
}
