#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  scanf("%lld%lld", &n, &k);
  long long a[200005];
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  vector<long long> diff;
  long long last = -200010;
  long long cow = 0;
  int i;
  for (i = 0; i < n; i++) {
    if (a[i] < 0) {
      diff.push_back(i - last - 1);
      last = i;
      cow++;
    }
  }
  long long ter = n - last - 1;
  sort(diff.begin(), diff.end());
  if (!diff.empty()) diff.resize(diff.size() - 1);
  if (cow > k) {
    printf("-1\n");
  } else {
    if (cow == 0) {
      printf("0\n");
    } else {
      if (cow >= n) {
        printf("1\n");
      } else {
        long long d = k - cow;
        long long qas = d;
        long long q = 0;
        i = 0;
        while (q < diff.size() && d > 0) {
          d -= diff[q];
          qas = d;
          q++;
          if (d < 0) {
            q--;
            qas = d + diff[q];
            d = 0;
          }
        }
        long long yue = 0;
        if (ter <= qas) {
          yue = 1;
        }
        printf("%lld\n", 2 * cow - 2 * q - yue);
      }
    }
  }
  return 0;
}
