#include <bits/stdc++.h>
using namespace std;
vector<int> t(500500);
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int kk = k;
  int cnt = 0;
  for (int i = 0; i < int(n); i++) {
    scanf("%d", &t[i + 1]);
    if (t[i + 1] < 0) cnt++;
  }
  if (cnt > k)
    printf("-1\n");
  else {
    k -= cnt;
    int j = 1;
    while (j <= n && t[j] >= 0) j++;
    if (j > n)
      printf("0\n");
    else {
      priority_queue<pair<int, int>, vector<pair<int, int> >,
                     greater<pair<int, int> > >
          pq;
      int cnt = 0;
      bool neg = true;
      vector<pair<int, int> > v;
      for (int i = j; i <= n; i++) {
        if (neg) {
          if (t[i] < 0)
            cnt++;
          else {
            v.push_back(make_pair(cnt, -1));
            neg = false;
            cnt = 1;
          }
        } else {
          if (t[i] >= 0)
            cnt++;
          else {
            v.push_back(make_pair(cnt, 1));
            neg = true;
            cnt = 1;
          }
        }
      }
      if (neg)
        v.push_back(make_pair(cnt, -1));
      else
        v.push_back(make_pair(cnt, 1));
      int solution1 = ((int)(v).size()), solution2 = ((int)(v).size()), l = k;
      for (int i = 0; i < ((int)(v).size()); i++)
        if (v[i].second == 1) {
          if (i != ((int)(v).size()) - 1)
            pq.push(make_pair(v[i].first, 0));
          else {
            if (v[i].first <= l) {
              l -= v[i].first;
              solution2--;
            }
          }
        }
      while (!pq.empty()) {
        if (pq.top().first <= k) {
          k -= pq.top().first;
          solution1 -= 2;
        }
        if (pq.top().first <= l) {
          l -= pq.top().first;
          solution2 -= 2;
        }
        pq.pop();
      }
      printf("%d\n", min(solution1, solution2));
    }
  }
}
