#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x7fffffff;
const long long mod = 1e9 + 7;
const double eps = 1e-8;
const long long linf = 1e18;
const long long MAXN = 2e5 + 10;
const long long MAXM = 1e6 + 10;
const double E = 2.718281828;
const double pi = acos(-1.0);
int a[MAXN], b[MAXN];
struct node {
  int rest;
  int s, t;
  bool operator<(const node& a) const { return rest < a.rest; }
} res[MAXN], res1[MAXN];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int need = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    if (a[i] < 0) ++need;
  }
  a[0] = 1;
  a[n + 1] = -1;
  if (m < need) {
    puts("-1");
    return 0;
  }
  m -= need;
  int k = 0;
  for (int i = 1; i <= n + 1; ++i) {
    if (a[i] < 0) {
      ++i;
      int cur = 0;
      int s = i, t = 0;
      while (a[i] >= 0 && i <= n + 1) {
        ++i;
        ++cur;
      }
      t = i - 1;
      --i;
      if (cur) {
        res[k].s = s;
        res[k].t = t;
        res[k++].rest = cur;
      }
    }
  }
  sort(res, res + k);
  int m1 = m;
  memcpy(b, a, sizeof(a));
  memcpy(res1, res, sizeof(res));
  for (int i = 0; i < k; ++i) {
    if (res[i].rest <= m) {
      m -= res[i].rest;
      for (int j = res[i].s; j <= res[i].t; ++j) a[j] = -1;
    } else {
      break;
    }
  }
  node temp;
  for (int i = 0; i < k; ++i) {
    if (res1[i].t == n) {
      temp = res1[i];
      continue;
    }
    if (res1[i].rest <= m1) {
      m1 -= res1[i].rest;
      for (int j = res1[i].s; j <= res1[i].t; ++j) b[j] = -1;
    } else {
      break;
    }
  }
  if (m1 >= temp.rest) {
    for (int i = temp.s; i <= temp.t; ++i) b[i] = -1;
  }
  int sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n; ++i) {
    if ((a[i] >= 0 && a[i - 1] < 0) || (a[i] < 0 && a[i - 1] >= 0)) ++sum1;
  }
  for (int i = 1; i <= n; ++i) {
    if ((b[i] >= 0 && b[i - 1] < 0) || (b[i] < 0 && b[i - 1] >= 0)) ++sum2;
  }
  printf("%d\n", min(sum1, sum2));
  return 0;
}
