#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;
using namespace std;
int a[105];
int b[105];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int x = 0;
  int y = 0;
  int cnt = 0;
  for (int i = 2; i != n; i += 2) {
    a[i - 2] % 2 == 1 ? x++ : y++;
    a[i - 1] % 2 == 1 ? x++ : y++;
    if (x == y) b[cnt++] = max(a[i], a[i - 1]) - min(a[i], a[i - 1]);
  }
  sort(b, b + cnt);
  int num = 0;
  for (int i = 0; i < cnt; i++) {
    if (m >= b[i]) {
      num++;
      m -= b[i];
    } else
      break;
  }
  printf("%d\n", num);
  return 0;
}
