#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
int n, len, arr[200000 + 7];
vector<int> seg;
int main() {
  int one, two, tot, sz, ans, l, i, j, k;
  while (scanf("%d %d", &n, &len) == 2) {
    tot = ans = 0;
    seg.clear();
    for (i = 0; i < n; i++) {
      scanf("%d", &arr[i]);
      if (arr[i] < 0) tot++;
    }
    if (tot > len) {
      printf("-1\n");
      continue;
    }
    two = len;
    one = 0;
    for (i = 0; i < n; i++) {
      if (arr[i] < 0) {
        ans = 1;
        break;
      }
    }
    for (i; i < n; i++) {
      if (arr[i] < 0) {
        l = 0;
        for (j = i + 1; j < n and arr[j] >= 0; j++) {
          l++;
        }
        if (j == n) {
          two = l;
          break;
        }
        if (l) {
          seg.push_back(l);
        }
        i += l;
      }
    }
    sort(seg.begin(), seg.end());
    sz = seg.size();
    ans += 2 * sz + 1;
    len -= tot;
    for (i = 0; i < sz; i++) {
      if (seg[i] <= len) {
        ans -= 2;
        len -= seg[i];
      } else {
        break;
      }
    }
    if (two <= len) {
      ans -= 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
