#include <bits/stdc++.h>
using namespace std;
int const lim = 3e5 + 3;
int const MLOG = 22;
multiset<int> mn;
int inp[lim + 3];
int main() {
  int n, k;
  cin >> n >> k;
  int last = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &inp[i]);
    int x = inp[i];
    if (x < 0) k--;
    if (i && x < 0 && inp[i - 1] >= 0) {
      if (last != 0) mn.insert(i - last);
      ans++;
    }
    if (!i && x < 0) ans++;
    if (i && x >= 0 && inp[i - 1] < 0) last = i, ans++;
  }
  int best = ans;
  if (k < 0) {
    printf("-1\n");
    return 0;
  }
  int kk = k;
  int anss = ans;
  for (multiset<int>::iterator it = mn.begin(); it != mn.end(); it++) {
    if (*it <= k)
      ans -= 2, k -= *it;
    else
      break;
  }
  best = min(best, ans);
  k = kk;
  ans = anss;
  if (last != 0 && inp[n - 1] >= 0 && k >= n - last) {
    k -= n - last, ans--;
    for (multiset<int>::iterator it = mn.begin(); it != mn.end(); it++) {
      if (*it <= k)
        ans -= 2, k -= *it;
      else
        break;
    }
    best = min(best, ans);
  }
  cout << best << endl;
}
