#include <bits/stdc++.h>
using namespace std;
short int ak[1000000];
typedef struct node {
  int x;
  int y;
  int val;
} ss;
ss app[1000000];
bool cmp(node p, node q) {
  if (p.val == q.val) return p.y < q.y;
  return p.val < q.val;
}
int main(void) {
  int n, m;
  while (scanf("%d %d", &n, &m) != EOF) {
    int i, sum = 0;
    int ans = 0;
    for (i = 0; i < n; i++) scanf("%d", &ak[i]);
    for (i = 0; i < n; i++)
      if (ak[i] < 0) sum++;
    ak[n] = -1;
    if (m < sum)
      printf("-1\n");
    else {
      if (ak[0] < 0) ans++;
      for (i = 1; i < n; i++) {
        if (ak[i] < 0 && ak[i - 1] >= 0) ans++;
        if (ak[i] >= 0 && ak[i - 1] < 0) ans++;
      }
      m -= sum;
      int cn = 0;
      for (i = 1; i < n;) {
        if (ak[i - 1] < 0 && ak[i] >= 0) {
          int j;
          for (j = i; j <= n && ak[j] >= 0;) {
            j++;
          }
          app[cn].x = i;
          app[cn].y = j - 1;
          i = j + 1;
          app[cn].val = app[cn].y - app[cn].x + 1;
          cn++;
        } else
          i++;
      }
      if (app[cn - 1].y == n - 1 && cn > 0)
        sort(app, app + cn - 1, cmp);
      else
        sort(app, app + cn, cmp);
      for (i = 0; i < cn; i++) {
        if (app[i].val <= m) {
          if (app[i].y != n - 1)
            ans -= 2;
          else
            ans--;
          m -= app[i].val;
        }
      }
      printf("%d\n", ans);
    }
  }
  return 0;
}
