#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cost, dif[105], v[105];
  cin >> n >> cost;
  int even, odd;
  even = odd = 0;
  int j = 0;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
  }
  for (int i = 1; i <= n; i++) {
    if (v[i] % 2 == 0)
      even++;
    else
      odd++;
    if (even == odd && i + 1 <= n) {
      j++;
      dif[j] = abs(v[i + 1] - v[i]);
    }
  }
  int cuts = 0;
  int sum = 0;
  sort(dif + 1, dif + j + 1);
  for (int i = 1; i <= j; i++) {
    sum += dif[i];
    if (sum <= cost) {
      cuts++;
    } else
      break;
  }
  cout << cuts;
  return 0;
}
