#include <bits/stdc++.h>
using namespace std;
int a[100], n;
int m[100][101][203];
int call(int i, int b, int k) {
  if (i == (n - 1)) return 0;
  if (m[i][b][k] != -1) return m[i][b][k];
  if (k == 101 && b >= abs(a[i] - a[i + 1])) {
    if (a[i + 1] % 2)
      m[i][b][k] = 1 + call(i + 1, b - abs(a[i] - a[i + 1]), 100);
    else
      m[i][b][k] = 1 + call(i + 1, b - abs(a[i] - a[i + 1]), 102);
  }
  if (a[i + 1] % 2)
    m[i][b][k] = max(m[i][b][k], call(i + 1, b, k - 1));
  else
    m[i][b][k] = max(m[i][b][k], call(i + 1, b, k + 1));
  return m[i][b][k];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int b, i;
  cin >> n >> b;
  memset(m, -1, sizeof(m));
  for (i = 0; i < n; i++) cin >> a[i];
  if (a[0] % 2)
    i = call(0, b, 100);
  else
    i = call(0, b, 102);
  cout << i;
  return 0;
}
