#include <bits/stdc++.h>
using namespace std;
long long n, k, a[200009], kk, z;
vector<long long> v;
long long num = 0;
long long ed = 0;
long long proc(long long x) {
  long long ret = num;
  for (long long i = 0; i < v.size(); i++) {
    if (v[i] <= x) {
      x -= v[i];
      ret -= 2;
    } else
      break;
  }
  if (x >= ed && ed != 0) ret--;
  return ret;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  kk = k;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] >= 0)
      a[i] = 0;
    else
      a[i] = 1;
    k -= a[i];
  }
  if (k < 0) {
    cout << -1;
    return 0;
  }
  num += a[0];
  for (long long i = 1; i < n; i++) {
    if (a[i] != a[i - 1]) num++;
  }
  for (long long i = n - 1; i >= 0; i--) {
    if (a[i]) {
      ed = i + 1;
      break;
    }
  }
  long long i = 0, c = 0;
  while (a[i] == 0) i++;
  for (i; i < ed; i++) {
    if (a[i] == 0)
      c++;
    else if (c) {
      v.push_back(c);
      c = 0;
    }
  }
  ed = n - ed;
  sort(v.begin(), v.end());
  long long ans = proc(k);
  cout << max(ans, z);
}
