#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int a[N];
int main() {
  int n, k, cnt = 0, firstPos = N;
  scanf("%d %d", &n, &k);
  vector<pair<int, bool>> segments;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] < 0) {
      if (!cnt) firstPos = i;
      ++cnt;
    }
  }
  if (cnt > k) {
    puts("-1");
    return 0;
  }
  int ans = 0;
  for (int i = 0; i < n;) {
    while (i < n && a[i] >= 0) ++i;
    if (i < n) ++ans;
    while (i < n && a[i] < 0) ++i;
  }
  ans *= 2;
  if (a[n - 1] < 0) --ans;
  k -= cnt;
  a[n] = -1;
  for (int i = firstPos; i <= n;) {
    if (a[i] < 0) {
      ++i;
      continue;
    }
    cnt = 0;
    while (a[i++] >= 0) ++cnt;
    segments.push_back({cnt, (i == n + 1)});
  }
  sort(segments.begin(), segments.end());
  int can = -1;
  for (int i = 0; i < (int)segments.size(); i++) {
    if (segments[i].first <= k) {
      if (segments[i].second == 1) {
        can = segments[i].first;
        continue;
      }
      k -= segments[i].first;
      ans -= 2;
    } else
      break;
  }
  if (can != -1 && k >= can) --ans;
  printf("%d\n", ans);
  return 0;
}
