#include <bits/stdc++.h>
using namespace std;
vector<int> vec;
int t[300000];
int main() {
  int n, k;
  cin >> n >> k;
  int tol = 0, ans = 0;
  int pre = -1, last = -1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
    if (t[i] < 0) {
      last = i;
      ans += 2;
      tol++;
      if (pre != -1) vec.push_back(i - pre - 1);
      pre = i;
    }
  }
  k -= tol;
  if (k < 0) {
    puts("-1");
  } else {
    sort(vec.begin(), vec.end());
    for (int i = 0; i < vec.size(); i++) {
      if (k - vec[i] >= 0) {
        k -= vec[i];
        ans -= 2;
      } else
        break;
    }
    if (n - last <= k) ans--;
    printf("%d\n", ans);
  }
}
