#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e5 + 1, Mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, k;
  cin >> n >> k;
  std::vector<int> v(n);
  for (auto &x : v) cin >> x;
  multiset<int> s;
  int pos = -1;
  long long count = 0;
  for (int i = 0; i < n; i++) {
    if (v[i] < 0) {
      count++;
      if (pos != -1) {
        s.insert(i - pos - 1);
      }
      pos = i;
    }
  }
  int fx;
  if (pos != -1) fx = n - 1 - pos;
  if (count > k) {
    cout << "-1\n";
    return 0;
  }
  long long ans = 0;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    if (!flag) {
      if (v[i] >= 0)
        continue;
      else {
        ans++;
        flag = flag ^ 1;
      }
    } else {
      if (v[i] < 0)
        continue;
      else {
        ans++;
        flag = flag ^ 1;
      }
    }
  }
  k -= count;
  int fl = 0;
  for (auto x : s) {
    if (x == 0) continue;
    if (k < x) {
      fl = 1;
      if (fx != 0 && x > fx && fx <= k) {
        k -= fx;
        ans -= 1;
      }
      break;
    }
    ans -= 2;
    k -= x;
  }
  if (!fl && fx != 0 && fx <= k) ans -= 1;
  cout << ans << "\n";
  return 0;
}
