#include <bits/stdc++.h>
using namespace std;
int temp[200010];
map<int, int> mp;
int main() {
  mp.clear();
  int n, k;
  scanf("%d%d", &n, &k);
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &temp[i]);
    if (temp[i] < 0) {
      cnt++;
    }
  }
  if (cnt > k)
    cout << "-1" << endl;
  else {
    int prev = 0;
    int rs = 0;
    int opt = abs(cnt - k);
    int firstWinter = -1, lastWinter = -1;
    for (int i = 1; i <= n; i++) {
      if (temp[i] < 0) {
        firstWinter = i;
        break;
      }
    }
    for (int i = n; i >= 1; i--) {
      if (temp[i] < 0) {
        lastWinter = i;
        break;
      }
    }
    if (firstWinter == -1) {
      cout << 0 << endl;
    } else {
      for (int i = 1; i <= n; i++) {
        if (temp[i] < 0 && prev == 0) {
          rs++;
          prev = 1;
        } else if (temp[i] >= 0 && prev == 1) {
          rs++;
          prev = 0;
        }
      }
      int trans = 0;
      if (firstWinter != lastWinter) {
        int dif = 0;
        for (int i = firstWinter; i <= lastWinter; i++) {
          if (temp[i] >= 0) {
            dif++;
          } else {
            mp[dif]++;
            dif = 0;
          }
        }
        map<int, int>::iterator it;
        for (it = mp.begin(); it != mp.end(); it++) {
          if (it->first > 0) {
            if (opt > 0 && it->first <= opt) {
              int dv = opt / it->first;
              opt -= it->first * min(dv, it->second);
              trans += min(dv, it->second);
            }
          }
        }
      }
      rs -= 2 * trans;
      int daysB = firstWinter - 1;
      int daysA = n - lastWinter;
      if (daysA != 0 && opt >= daysA) rs--;
      cout << rs << endl;
    }
  }
  return 0;
}
