#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, b;
  cin >> n >> b;
  vector<long long int> v(n + 1, 0), odd(n + 1, 0), even(n + 1, 0);
  vector<long long int> ans;
  for (long long int i = 1; i <= n; i++) {
    cin >> v[i];
    if (v[i] % 2 == 0) {
      odd[i] = odd[i - 1];
      even[i] = even[i - 1] + 1;
    } else {
      odd[i] = odd[i - 1] + 1;
      even[i] = even[i - 1];
    }
  }
  for (long long int i = 1; i <= n; i++) {
    if (odd[i] == even[i]) {
      ans.push_back(abs(v[i] - v[i + 1]));
    }
  }
  sort(ans.begin(), ans.end());
  long long int yo = 0;
  long long int temp = 0;
  for (long long int i = 0; i <= ans.size() - 1; i++) {
    temp += ans[i];
    if (temp <= b) {
      yo++;
    } else {
      cout << yo << endl;
      break;
    }
  }
  return 0;
}
