#include <bits/stdc++.h>
using namespace std;
template <class T>
T min(T a, T b, T c) {
  return min(a, min(b, c));
}
template <class T>
T max(T a, T b, T c) {
  return max(a, max(b, c));
}
template <class T>
void read(vector<T> &v) {
  T x;
  cin >> x;
  v.push_back(x);
}
int n, k, a[200005], ans = 1000000007;
vector<int> v;
int Solve(int k) {
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  int cnt = 0;
  for (__typeof(v.begin()) it = v.begin(); it != v.end(); it++) {
    if (k > 0) {
      k -= *it;
      cnt += 2;
    }
  }
  if (k > 0) return 1000000007;
  return cnt;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = (1); i <= (n); ++i) scanf("%d", &a[i]);
  int cnt = 0;
  for (int i = (1); i <= (n + 1); ++i) {
    if (i == n + 1 || (i > 1 && (a[i] >= 0) ^ (a[i - 1] >= 0))) {
      if (a[i - 1] >= 0) v.push_back(cnt);
      cnt = 0;
    }
    ++cnt;
  }
  if (a[1] >= 0) {
    k += *v.begin();
    v.erase(v.begin());
  }
  if (v.size() == 0) {
    if (a[1] >= 0) {
      if (a[n] < 0) {
        if (n - k > 0)
          puts("-1");
        else
          puts("1");
      } else
        puts("0");
    } else {
      if (n == k)
        puts("1");
      else
        puts("-1");
    }
    return 0;
  }
  if (a[n] >= 0) {
    int x = *v.rbegin();
    v.pop_back();
    ans = min(ans, Solve(n - k - x) + 2);
  }
  ans = min(ans, Solve(n - k) + 1);
  if (ans == 1000000007)
    puts("-1");
  else
    printf("%d", ans);
  return 0;
}
