#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int arr[maxn];
vector<pair<int, int> > d;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k, i, ans = 0;
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> arr[i];
    if (arr[i] < 0) {
      k--;
    }
  }
  if (k < 0) {
    cout << -1;
    return 0;
  }
  i = 1;
  while (i <= n && arr[i] >= 0) i++;
  for (; i <= n;) {
    ans++;
    while (i <= n && arr[i] < 0) i++;
    ans++;
    int curr = i;
    while (i <= n && arr[i] >= 0) i++;
    if (i > n)
      d.push_back({-1, i - curr});
    else
      d.push_back({-2, i - curr});
  }
  sort(d.begin(), d.end());
  for (i = 0; i < int(d.size()); i++) {
    if (k >= d[i].second) {
      k -= d[i].second;
      ans += d[i].first;
    }
  }
  cout << ans;
  return 0;
}
