#include <bits/stdc++.h>
using namespace std;
int arr[200001];
int width[200001];
int k;
int solve(int ret, int segments) {
  sort(width, width + segments);
  for (int i = 0; i < segments && k >= 0; i++)
    if (k - width[i] > -1)
      ret -= 2, k -= width[i];
    else
      break;
  return ret;
}
int main() {
  bool flag = false;
  int n, windays = 0, segments = 0, count = 0;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    if (arr[i] < 0) {
      if (arr[i - 1] > -1 && i > 0 && windays) width[segments++] = count;
      count = 0, windays++;
    } else if (windays)
      if (i == n - 1)
        width[segments++] = ++count, flag = true;
      else
        count++;
  }
  if (windays > k)
    printf("-1\n");
  else if (!windays)
    printf("0\n");
  else {
    int ret = (segments)*2;
    k -= windays;
    if (flag) {
      ret = solve(ret, segments - 1);
      if (k - width[segments - 1] > -1) ret--;
    } else
      ret = solve(ret, segments) + 1;
    printf("%d\n", ret);
  }
  return 0;
}
