#include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, greater<int> > p;
int main() {
  int n, k;
  cin >> n >> k;
  int pre = -1;
  bool st = false;
  int q = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a < 0) {
      if (st)
        p.push(i - pre - 1);
      else
        st = !st;
      pre = i;
      q++;
    }
  }
  if (q > k) {
    cout << "-1";
    return 0;
  }
  ans = 2 * q;
  k -= q;
  while (!p.empty()) {
    int a = p.top();
    p.pop();
    if (a > k) break;
    k -= a;
    ans -= 2;
  }
  if (pre != -1) {
    int l = n - 1 - pre;
    if (l <= k) ans--;
  }
  cout << ans << endl;
}
