#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b, long long MOD) {
  long long res = 1;
  a %= MOD;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
  }
  return res;
}
const int maxn = 2e5 + 10;
int n, k, t[maxn];
multiset<int> S;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", t + i);
  int cnt = 0;
  for (int i = 0; i < n; ++i)
    if (t[i] < 0) ++cnt;
  if (k < cnt) return 0 * printf("-1\n");
  int st = -1;
  for (int i = 0; i < n; ++i) {
    if (t[i] < 0) {
      if (st != -1) S.insert(i - st - 1);
      st = i;
    }
  }
  k -= cnt;
  int ans = 2 * cnt;
  while (k >= 0 && !S.empty()) {
    auto c = S.begin();
    if (k >= *c) {
      k -= *c;
      S.erase(c);
      ans -= 2;
    } else
      break;
  }
  if (st != -1 && k - n + st + 1 >= 0) --ans;
  printf("%d\n", ans);
}
