#include <bits/stdc++.h>
bool isprime(long long n);
long long fibonacci(long long x);
long long factorial(long long x);
long long permutations(long long x, long long y);
long double combinations(long double x, long double y);
using namespace std;
void SieveOfEratosthenes(int n, bool prime[], bool primesquare[], int a[]) {
  for (int i = 2; i <= n; i++) prime[i] = true;
  for (int i = 0; i <= (n * n + 1); i++) primesquare[i] = false;
  prime[1] = false;
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * 2; i <= n; i += p) prime[i] = false;
    }
  }
  int j = 0;
  for (int p = 2; p <= n; p++) {
    if (prime[p]) {
      a[j] = p;
      primesquare[p * p] = true;
      j++;
    }
  }
}
int countDivisors(int n) {
  if (n == 1) return 1;
  bool prime[n + 1], primesquare[n * n + 1];
  int a[n];
  SieveOfEratosthenes(n, prime, primesquare, a);
  int ans = 1;
  for (int i = 0;; i++) {
    if (a[i] * a[i] * a[i] > n) break;
    int cnt = 1;
    while (n % a[i] == 0) {
      n = n / a[i];
      cnt = cnt + 1;
    }
    ans = ans * cnt;
  }
  if (prime[n])
    ans = ans * 2;
  else if (primesquare[n])
    ans = ans * 3;
  else if (n != 1)
    ans = ans * 4;
  return ans;
}
long long Divisors(long long x) {
  long long c = 0;
  for (long long i = 1; i <= x; i++) {
    if (x % i == 0) {
      c++;
    }
  }
  return c;
}
long long division(long long x) {
  int c = 0, i;
  for (i = 1; i * i < x; i++)
    if (x % i == 0) c += 2;
  if (i * i == x) c++;
  return c;
}
int countDivisors2(int n) {
  int cnt = 0;
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        cnt++;
      else
        cnt = cnt + 2;
    }
  }
  return cnt;
}
unsigned long long div(unsigned long long x) {
  unsigned long long counter = 0, i;
  for (i = 1; i * i < x; i++) {
    if (x % i == 0) {
      counter += 2;
    }
  }
  if (i * i == x) counter++;
  return counter;
}
unsigned GCD(unsigned u, unsigned v) {
  while (v != 0) {
    unsigned r = u % v;
    u = v;
    v = r;
  }
  return u;
}
long long lcm(long long a, long long b) { return (a * b) / GCD(a, b); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  vector<int> v;
  int n, bitcoins, odd = 0, even = 0, answer = 0;
  cin >> n >> bitcoins;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    if (i != 0 && even == odd) v.push_back(abs(arr[i] - arr[i - 1]));
    if (arr[i] % 2)
      odd++;
    else
      even++;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    if (v[i] <= bitcoins) {
      bitcoins -= v[i];
      answer++;
      continue;
    }
    break;
  }
  cout << answer;
  return 0;
}
long long factorial(long long x) {
  long long fact = 1;
  for (long long i = 1; i <= x; i++) {
    fact *= i;
  }
  return fact;
}
long long permutations(long long x, long long y) {
  long long fact1 = 1;
  for (long long i = 1; i <= max(x, y); i++) {
    fact1 *= i;
  }
  long long fact2 = 1;
  for (long long i = 1; i <= abs(x - y); i++) {
    fact2 *= i;
  }
  return fact1 / fact2;
}
long double combinations(long double x, long double y) {
  long long ans = 1;
  for (long double i = 0, w = min(y, abs(x - y)); i < w; i++) {
    ans *= (x - i) / (i + 1);
  }
  return ans;
}
long long fibonacci(long long x) {
  if (x == 1) return 1;
  if (x == 0) return 0;
  return fibonacci(x - 1) + fibonacci(x - 2);
}
bool isprime(long long n) {
  if (n == 1)
    return false;
  else if (n == 2)
    return true;
  for (long long i = 2; i < n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
