#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, B, i, t;
  cin >> n >> B;
  vector<int> input;
  for (i = 0; i < n; i++) {
    cin >> t;
    input.push_back(t);
  }
  vector<int> possibleCutCost;
  int oddCount = 0;
  int evenCount = 0;
  for (i = 0; i < n - 1; i++) {
    if (input[i] % 2 == 0) {
      evenCount++;
    } else {
      oddCount++;
    }
    if (evenCount == oddCount) {
      possibleCutCost.push_back(abs(input[i] - input[i + 1]));
    }
  }
  sort(possibleCutCost.begin(), possibleCutCost.end());
  int answer = 0;
  for (int i = 0; i < possibleCutCost.size(); i++) {
    if (B >= possibleCutCost[i]) {
      B -= possibleCutCost[i];
      answer++;
    } else {
      break;
    }
  }
  cout << answer << endl;
  return 0;
}
