#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  for (long long &i : v) cin >> i;
  long long neg = 0;
  for (long long i = 0; i < n; ++i) {
    if (v[i] < 0) neg++;
  }
  if (neg > k) {
    puts("-1");
    return 0;
  }
  long long ans = 0;
  vector<pair<long long, long long>> gaps;
  long long extra = k - neg;
  long long cnt = 0;
  bool summer = 1;
  for (long long i = 0; i < n; ++i) {
    if (v[i] < 0) {
      if (summer) {
        ans++;
        summer = 0;
      }
    } else {
      if (!summer) {
        ans++;
        summer = 1;
      }
    }
  }
  bool seen = 0;
  for (long long i = 0; i < n; ++i) {
    if (v[i] < 0) {
      if (cnt > 0 && seen) gaps.push_back({cnt, -2});
      seen = 1;
      cnt = 0;
    } else {
      cnt++;
    }
  }
  sort(gaps.begin(), gaps.end());
  for (pair<long long, long long> i : gaps) {
    if (extra >= i.first) {
      extra -= i.first;
      ans += i.second;
    }
  }
  if (cnt > 0 && seen && extra >= cnt) {
    ans--;
  }
  cout << ans;
  return 0;
}
