#include <bits/stdc++.h>
using namespace std;
int n, k, a[200005];
int num, dq;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  num = 0;
  for (int i = 1; i <= n; ++i)
    if (a[i] < 0) num++;
  if (num == 0) {
    cout << 0 << endl;
    return 0;
  }
  if (num > k) {
    cout << -1 << endl;
    return 0;
  }
  k -= num;
  int i = 1, ans = 0;
  num = 0;
  int tt = -1;
  while (a[i] >= 0) ++i;
  while (i <= n) {
    dq = 0;
    int j = i;
    while (i <= n && a[i] >= 0) ++i, ++dq;
    if (j != i) {
      ans++;
      if (i <= n)
        ++num, a[num] = dq;
      else {
        tt = dq;
      }
    }
    if (i <= n) ans++;
    while (i <= n && a[i] < 0) ++i;
  }
  sort(a + 1, a + num + 1);
  int dqk = k, dqans = ans;
  for (int i = 1; i <= num; ++i) {
    if (dqk >= a[i]) {
      dqans -= 2;
      dqk -= a[i];
    }
  }
  if (tt != -1) {
    if (k >= tt) {
      ans--;
      k -= tt;
    }
    for (int i = 1; i <= num; ++i) {
      if (k >= a[i]) {
        ans -= 2;
        k -= a[i];
      }
    }
  }
  ans = min(ans, dqans);
  cout << ans << endl;
  return 0;
}
