#include <bits/stdc++.h>
using namespace std;
const int inf = 987654321;
const long long int INF = 123456789987654321;
FILE *fin, *fout;
int N, K;
vector<int> temp, nega, diff;
int main() {
  scanf("%d %d", &N, &K);
  temp.resize(N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &temp[i]);
  }
  for (int i = 0; i < N; i++) {
    if (temp[i] < 0) nega.push_back(i);
  }
  if ((int)nega.size() > K) {
    printf("-1");
    return 0;
  }
  if (nega.size() == 0) {
    printf("0");
    return 0;
  }
  int ans;
  if (1) {
    int remain = K - (int)nega.size();
    int ans1 = 2 * (int)nega.size();
    for (int i = 0; i < (int)nega.size() - 1; i++) {
      diff.push_back(nega[i + 1] - nega[i] - 1);
    }
    sort((diff).begin(), (diff).end());
    for (int i = 0; i < diff.size(); i++) {
      if (diff[i] <= remain) {
        ans1 -= 2;
        remain -= diff[i];
      } else
        break;
    }
    ans = ans1;
  }
  if (K - (int)nega.size() >= N - 1 - nega.back()) {
    int remain = K - (int)nega.size();
    int ans2 = 2 * (int)nega.size();
    remain -= (N - 1 - nega.back());
    ans2--;
    diff.clear();
    for (int i = 0; i < (int)nega.size() - 1; i++) {
      diff.push_back(nega[i + 1] - nega[i] - 1);
    }
    sort((diff).begin(), (diff).end());
    for (int i = 0; i < diff.size(); i++) {
      if (diff[i] <= remain) {
        ans2 -= 2;
        remain -= diff[i];
      } else
        break;
    }
    ans = min(ans, ans2);
  }
  printf("%d", ans);
}
