#include <bits/stdc++.h>
using namespace std;
int n, d, v[102], c, g[102], k, S;
int main(void) {
  cin >> n >> d;
  for (int i = 1; i <= n; i++) cin >> v[i];
  for (int i = 1; i < n; i++) {
    if (v[i] % 2)
      c++;
    else
      c--;
    if (c == 0) g[k++] = abs(v[i] - v[i + 1]);
  }
  sort(g, g + k);
  for (S = 0; S < k && d >= g[S]; S++) d -= g[S];
  cout << S;
}
