#include <bits/stdc++.h>
using namespace std;
int arr[500];
int n, b;
int main() {
  scanf("%d %d", &n, &b);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  vector<pair<int, int>> rqarr;
  for (int i = 0; i < n - 1; i++)
    rqarr.emplace_back(abs(arr[i] - arr[i + 1]), i + 1);
  sort(rqarr.begin(), rqarr.end());
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    int loc = rqarr[i].second, cost = rqarr[i].first;
    int e = 0, o = 0;
    for (int j = 0; j < loc; j++) {
      if (arr[j] % 2)
        o++;
      else
        e++;
    }
    if (e == o && b - cost >= 0) cnt++, b -= cost;
  }
  printf("%d", cnt);
  return 0;
}
