#include <bits/stdc++.h>
using namespace std;
const int M = 3000010, mod = 1000000007;
int A[M];
vector<int> gap;
int main() {
  ios_base::sync_with_stdio(false);
  int n, i, j, k, p, sum = 0, cold = 0;
  scanf("%d%d", &n, &p);
  for (i = 0; i < n; i++) {
    scanf("%d", &A[i]);
    if (A[i] < 0)
      A[i] = 1;
    else
      A[i] = 0;
    cold += A[i];
  }
  if (cold > p) {
    printf("%s\n", "-1");
    return 0;
  };
  if (cold == 0) {
    printf("%s\n", "0");
    return 0;
  };
  sum = (A[0] == 1);
  for (i = 1; i < n; i++)
    if (A[i] != A[i - 1]) sum++;
  int l = 0;
  while (A[l] == 0) l++;
  int r = n - 1;
  while (A[r] == 0) r--;
  for (i = l; i <= r; i++) {
    if (A[i] == 0) {
      for (j = i; j <= r; j++)
        if (A[j] == 1) break;
      gap.push_back(j - i);
      i = j - 1;
    }
  }
  sort((gap).begin(), (gap).end());
  i = 0;
  while (i < gap.size() && cold + gap[i] <= p) {
    cold += gap[i];
    sum -= 2;
    i++;
  }
  if (r < n - 1) {
    if (cold + (n - r - 1) <= p) sum--;
  }
  printf("%d\n", sum);
  return 0;
}
