#include <bits/stdc++.h>
using namespace std;
int a[110], s[110];
vector<int> S;
int main() {
  int i, n, m;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] % 2)
      s[i] = s[i - 1] + 1;
    else
      s[i] = s[i - 1] - 1;
  }
  for (i = 1; i < n; i++) {
    if (s[i] == 0) {
      S.push_back(abs(a[i] - a[i + 1]));
    }
  }
  sort(S.begin(), S.end());
  int ans = 0;
  for (auto x : S) {
    if (m - x >= 0) {
      m -= x;
      ans++;
    }
  }
  printf("%d", ans);
  return 0;
}
