#include <bits/stdc++.h>
using namespace std;
int main() {
  priority_queue<int, vector<int>, greater<int> > q;
  int n, k, s = -1, t, i, r = 0, last = -1;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> t;
    if (t < 0) {
      if (s == -1 || s > 0) r++;
      if (s > 0) {
        q.push(s);
      }
      k--;
      s = 0;
    } else {
      if (s != -1) {
        if (s++ == 0) r++;
      }
    }
  }
  if (s > 0) last = s;
  while (!q.empty() && k - q.top() >= 0) {
    k -= q.top();
    q.pop();
    r -= 2;
  }
  if (last > -1 && last <= k) r--;
  cout << (k >= 0 ? r : -1) << '\n';
}
