#include <bits/stdc++.h>
using namespace std;
long long int cmp(const long long int& a, const long long int& b) {
  return a + 1 > b + 1;
}
int main() {
  long long int i, j = 0, k, t = 0, c = 0, w = 0, m, n, a1, b1, c1, a2, b2, c2,
                   s = 0;
  cin >> n >> k;
  long long int arr[n + 1];
  arr[0] = 5;
  vector<long long int> a;
  for (i = 1; i <= n; i++) {
    cin >> arr[i];
    if (arr[i] >= 0)
      arr[i] = 1;
    else
      arr[i] = -1;
  }
  for (i = 1; i <= n; i++) {
    if (arr[i] < 0) {
      w++;
      if (arr[i] != arr[i - 1]) s++;
      if (j == 1) {
        if (arr[i] != arr[i - 1]) a.push_back(c);
        c = 0;
      } else {
        j = 1;
        c = 0;
      }
    } else
      c++;
  }
  if (w > k) return cout << "-1", 0;
  if (w == 0) return cout << '0', 0;
  m = 2 * s;
  t = c;
  if (arr[n] < 0) m--;
  n = a.size();
  sort(a.begin(), a.end());
  k = k - w;
  for (i = 0; i < n; i++) {
    if (a[i] <= k) {
      m -= 2;
      k = k - a[i];
    }
  }
  if (k > 0 and t > 0 and t <= k) m--;
  cout << m;
  return 0;
}
