#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int arr[N];
int n, m;
vector<int> v;
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", arr + i);
  int odd = 0;
  int even = 0;
  for (int i = 1; i < n; ++i) {
    if (arr[i] & 1)
      ++odd;
    else
      ++even;
    if (odd == even) v.push_back(abs(arr[i] - arr[i + 1]));
  }
  sort(v.begin(), v.end());
  int cnt = 0;
  for (auto it : v) {
    m -= it;
    if (m >= 0) cnt++;
    if (m < 0) break;
  }
  printf("%d\n", cnt);
}
