#include <bits/stdc++.h>
using namespace std;
int fun(int a, int b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
int main(void) {
  int n, b;
  int i, j;
  int a[105];
  int c[105];
  int num = 0;
  int temp = 0;
  int answer = 0;
  int num_o = 0, num_e = 0;
  cin >> n >> b;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0)
      num_o++;
    else
      num_e++;
  }
  if (num_o != num_e) {
    cout << "0" << endl;
    return 0;
  }
  num_o = 0, num_e = 0;
  for (i = 0, j = 0; i < n - 1; i++) {
    if (a[i] % 2 == 0) {
      num_o++;
    } else {
      num_e++;
    }
    if (num_o == num_e && fun(a[i], a[i + 1]) <= b) {
      answer++;
      c[j] = fun(a[i], a[i + 1]);
      j++;
      num_o = 0;
      num_e = 0;
    }
  }
  sort(c, c + answer);
  for (i = 0; i < answer; i++) {
    temp += c[i];
    if (temp <= b) {
      num++;
    } else {
      break;
    }
  }
  cout << num << endl;
  return 0;
}
