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