import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class K implements Runnable {

  public static void main(String[] args) {
    new Thread(null, new K(), "", 1 << 28).start();
  }

  static int n;
  static int k;
  static int[] t;

  public void run() {
    FastScanner sc = new FastScanner();
    n = sc.nextInt();
    k = sc.nextInt();
    t = sc.intArray(n);
    memo = new int[2][n + 1];

    ref ref = new ref(k);
    int swap = solve(ref);
    if (swap < 0) {
      System.out.println(-1);
      return;
    }

    int leftover = ref.k;
    if (leftover < 0) {
      System.out.println(-1);
      return;
    }

    Queue<Gap> gaps = new PriorityQueue<>();
    Gap g = null;
    int i = 0;
    boolean summer = true;
    while (i < n) {
      if (t[i] >= 0) {
        if (g == null && !summer) {
          g = new Gap();
          g.s = i;
        }
        summer = true;
      } else {
        summer = false;
        if (g != null) {
          g.e = i;
          gaps.offer(g);
          g = null;
        }
      }
      i++;
    }
    if (g != null) {
      g.e = n;
    }

    while (leftover > 0 && !gaps.isEmpty() && gaps.peek().e - gaps.peek().s <= leftover) {
      Gap qq = gaps.poll();
      leftover -= (qq.e - qq.s);
      swap -= 2;
    }

    if (g != null && g.e - g.s <= leftover) {
      swap -= 1;
    }

    System.out.println(swap);

  }

  static int[][] memo;

  static int solve(ref ref) {
    if (ref.day == n) {
      return 0;
    }
    if (k == 0 && t[ref.day] < 0) {
      return Integer.MIN_VALUE;
    }

    if (ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref) + 1;
    } else if (!ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref);
    } else if (ref.summer && t[ref.day] >= 0) {
      ref.summer = true;
      ref.day += 1;
      return solve(ref);
    } else {
      ref.summer = true;
      ref.day += 1;
      return solve(ref) + 1;
    }
  }

  static class ref {
    boolean summer;
    int day;
    int k;

    ref(int k) {
      summer = true;
      day = 0;
      this.k = k;
    }
  }

  static class Gap implements Comparable<Gap> {
    int s, e;

    @Override
    public int compareTo(Gap other) {

      int res = Integer.compare(e - s, other.e - other.s);
      if (res == 0) {
        return Integer.compare(e, other.e);
      } else {
        return res;
      }
    }
  }

  class FastScanner {
    BufferedReader reader;
    StringTokenizer tokenizer;

    FastScanner() {
      reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
      tokenizer = null;
    }

    String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    int[] intArray(int size) {
      int[] ret = new int[size];
      for (int i = 0; i < size; i++) {
        ret[i] = nextInt();
      }
      return ret;
    }

    String[] stringArray(int size) {
      String[] ret = new String[size];
      for (int i = 0; i < size; i++) {
        ret[i] = next();
      }
      return ret;
    }
  }
}


import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class K implements Runnable {

  public static void main(String[] args) {
    new Thread(null, new K(), "", 1 << 28).start();
  }

  static int n;
  static int k;
  static int[] t;

  public void run() {
    FastScanner sc = new FastScanner();
    n = sc.nextInt();
    k = sc.nextInt();
    t = sc.intArray(n);
    memo = new int[2][n + 1];

    ref ref = new ref(k);
    int swap = solve(ref);
    if (swap < 0) {
      System.out.println(-1);
      return;
    }

    int leftover = ref.k;
    if (leftover < 0) {
      System.out.println(-1);
      return;
    }

    Queue<Gap> gaps = new PriorityQueue<>();
    Gap g = null;
    int i = 0;
    boolean summer = true;
    while (i < n) {
      if (t[i] >= 0) {
        if (g == null && !summer) {
          g = new Gap();
          g.s = i;
        }
        summer = true;
      } else {
        summer = false;
        if (g != null) {
          g.e = i;
          gaps.offer(g);
          g = null;
        }
      }
      i++;
    }
    if (g != null) {
      g.e = n;
      gaps.offer(g);
    }

    while (leftover > 0 && !gaps.isEmpty() && gaps.peek().e - gaps.peek().s <= leftover) {
      Gap qq = gaps.poll();
      leftover -= (qq.e - qq.s);

      if (qq.e == n)
        swap -= 1;
      else
        swap -= 2;
    }

    System.out.println(swap);

  }

  static int[][] memo;

  static int solve(ref ref) {
    if (ref.day == n) {
      return 0;
    }
    if (k == 0 && t[ref.day] < 0) {
      return Integer.MIN_VALUE;
    }

    if (ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref) + 1;
    } else if (!ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref);
    } else if (ref.summer && t[ref.day] >= 0) {
      ref.summer = true;
      ref.day += 1;
      return solve(ref);
    } else {
      ref.summer = true;
      ref.day += 1;
      return solve(ref) + 1;
    }
  }

  static class ref {
    boolean summer;
    int day;
    int k;

    ref(int k) {
      summer = true;
      day = 0;
      this.k = k;
    }
  }

  static class Gap implements Comparable<Gap> {
    int s, e;

    @Override
    public int compareTo(Gap other) {

      int res = Integer.compare(e - s, other.e - other.s);
      if (res == 0) {
        return Integer.compare(e, other.e);
      } else {
        return res;
      }
    }
  }

  class FastScanner {
    BufferedReader reader;
    StringTokenizer tokenizer;

    FastScanner() {
      reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
      tokenizer = null;
    }

    String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    int[] intArray(int size) {
      int[] ret = new int[size];
      for (int i = 0; i < size; i++) {
        ret[i] = nextInt();
      }
      return ret;
    }

    String[] stringArray(int size) {
      String[] ret = new String[size];
      for (int i = 0; i < size; i++) {
        ret[i] = next();
      }
      return ret;
    }
  }
}


import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class K implements Runnable {

  public static void main(String[] args) {
    new Thread(null, new K(), "", 1 << 28).start();
  }

  static int n;
  static int k;
  static int[] t;

  public void run() {
    FastScanner sc = new FastScanner();
    n = sc.nextInt();
    k = sc.nextInt();
    t = sc.intArray(n);
    memo = new int[2][n + 1];

    ref ref = new ref(k);
    int swap = solve(ref);
    if (swap < 0) {
      System.out.println(-1);
      return;
    }

    int leftover = ref.k;

    Queue<Gap> gaps = new PriorityQueue<>();
    Gap g = null;
    int i = 0;
    boolean summer = true;
    while (i < n) {
      if (t[i] >= 0) {
        if (g == null && !summer) {
          g = new Gap();
          g.s = i;
        }
        summer = true;
      } else {
        summer = false;
        if (g != null) {
          g.e = i;
          gaps.offer(g);
          g = null;
        }
      }
      i++;
    }
    if (g != null) {
      g.e = n;
      gaps.offer(g);
    }

    while (leftover > 0 && gaps.peek().e - gaps.peek().s <= leftover) {
      Gap qq = gaps.poll();
      leftover -= (qq.e - qq.s);

      if (qq.e == n)
        swap -= 1;
      else
        swap -= 2;
    }

    System.out.println(swap);

  }

  static int[][] memo;

  static int solve(ref ref) {
    if (ref.day == n) {
      return 0;
    }
    if (k == 0 && t[ref.day] < 0) {
      return Integer.MIN_VALUE;
    }

    if (ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref) + 1;
    } else if (!ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref);
    } else if (ref.summer && t[ref.day] >= 0) {
      ref.summer = true;
      ref.day += 1;
      return solve(ref);
    } else {
      ref.summer = true;
      ref.day += 1;
      return solve(ref) + 1;
    }
  }

  static class ref {
    boolean summer;
    int day;
    int k;

    ref(int k) {
      summer = true;
      day = 0;
      this.k = k;
    }
  }

  static class Gap implements Comparable<Gap> {
    int s, e;

    @Override
    public int compareTo(Gap other) {

      int res = -Integer.compare(e - s, other.e - other.s);
      if (res == 0) {
        return -Integer.compare(other.e, e);
      } else {
        return res;
      }
    }
  }

  class FastScanner {
    BufferedReader reader;
    StringTokenizer tokenizer;

    FastScanner() {
      reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
      tokenizer = null;
    }

    String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    int[] intArray(int size) {
      int[] ret = new int[size];
      for (int i = 0; i < size; i++) {
        ret[i] = nextInt();
      }
      return ret;
    }

    String[] stringArray(int size) {
      String[] ret = new String[size];
      for (int i = 0; i < size; i++) {
        ret[i] = next();
      }
      return ret;
    }
  }
}


import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class K implements Runnable {

  public static void main(String[] args) {
    new Thread(null, new K(), "", 1 << 28).start();
  }

  static int n;
  static int k;
  static int[] t;

  public void run() {
    FastScanner sc = new FastScanner();
    n = sc.nextInt();
    k = sc.nextInt();
    t = sc.intArray(n);
    memo = new int[2][n + 1];

    ref ref = new ref(k);
    int swap = solve(ref);
    if (swap < 0) {
      System.out.println(-1);
      return;
    }

    int leftover = ref.k;
    if (leftover < 0) {
      System.out.println(-1);
      return;
    }

    Queue<Gap> gaps = new PriorityQueue<>();
    Gap g = null;
    int i = 0;
    boolean summer = true;
    while (i < n) {
      if (t[i] >= 0) {
        if (g == null && !summer) {
          g = new Gap();
          g.s = i;
        }
        summer = true;
      } else {
        summer = false;
        if (g != null) {
          g.e = i;
          gaps.offer(g);
          g = null;
        }
      }
      i++;
    }
    if (g != null) {
      g.e = n;
      gaps.offer(g);
    }

    while (leftover > 0 && gaps.peek().e - gaps.peek().s <= leftover) {
      Gap qq = gaps.poll();
      leftover -= (qq.e - qq.s);

      if (qq.e == n)
        swap -= 1;
      else
        swap -= 2;
    }

    System.out.println(swap);

  }

  static int[][] memo;

  static int solve(ref ref) {
    if (ref.day == n) {
      return 0;
    }
    if (k == 0 && t[ref.day] < 0) {
      return Integer.MIN_VALUE;
    }

    if (ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref) + 1;
    } else if (!ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref);
    } else if (ref.summer && t[ref.day] >= 0) {
      ref.summer = true;
      ref.day += 1;
      return solve(ref);
    } else {
      ref.summer = true;
      ref.day += 1;
      return solve(ref) + 1;
    }
  }

  static class ref {
    boolean summer;
    int day;
    int k;

    ref(int k) {
      summer = true;
      day = 0;
      this.k = k;
    }
  }

  static class Gap implements Comparable<Gap> {
    int s, e;

    @Override
    public int compareTo(Gap other) {

      int res = Integer.compare(e - s, other.e - other.s);
      if (res == 0) {
        return Integer.compare(e, other.e);
      } else {
        return res;
      }
    }
  }

  class FastScanner {
    BufferedReader reader;
    StringTokenizer tokenizer;

    FastScanner() {
      reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
      tokenizer = null;
    }

    String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    int[] intArray(int size) {
      int[] ret = new int[size];
      for (int i = 0; i < size; i++) {
        ret[i] = nextInt();
      }
      return ret;
    }

    String[] stringArray(int size) {
      String[] ret = new String[size];
      for (int i = 0; i < size; i++) {
        ret[i] = next();
      }
      return ret;
    }
  }
}


import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class K implements Runnable {

  public static void main(String[] args) {
    new Thread(null, new K(), "", 1 << 28).start();
  }

  static int n;
  static int k;
  static int[] t;

  public void run() {
    FastScanner sc = new FastScanner();
    n = sc.nextInt();
    k = sc.nextInt();
    t = sc.intArray(n);
    memo = new int[2][n + 1];

    ref ref = new ref(k);
    int swap = solve(ref);
    if (swap < 0) {
      System.out.println(-1);
      return;
    }

    int leftover = ref.k;

    Queue<Gap> gaps = new PriorityQueue<>();
    Gap g = null;
    int i = 0;
    boolean summer = true;
    while (i < n) {
      if (t[i] >= 0) {
        if (g == null && !summer) {
          g = new Gap();
          g.s = i;
        }
        summer = true;
      } else {
        summer = false;
        if (g != null) {
          g.e = i;
          gaps.offer(g);
          g = null;
        }
      }
      i++;
    }
    if (g != null) {
      g.e = n;
      gaps.offer(g);
    }

    while (leftover > 0 && gaps.peek().e - gaps.peek().s <= leftover) {
      Gap qq = gaps.poll();
      leftover -= (qq.e - qq.s);

      if (qq.e == n)
        swap -= 1;
      else
        swap -= 2;
    }

    System.out.println(swap);

  }

  static int[][] memo;

  static int solve(ref ref) {
    if (ref.day == n) {
      return 0;
    }
    if (k == 0 && t[ref.day] < 0) {
      return Integer.MIN_VALUE;
    }

    if (ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref) + 1;
    } else if (!ref.summer && t[ref.day] < 0) {
      ref.summer = false;
      ref.day += 1;
      ref.k -= 1;
      return solve(ref);
    } else if (ref.summer && t[ref.day] >= 0) {
      ref.summer = true;
      ref.day += 1;
      return solve(ref);
    } else {
      ref.summer = true;
      ref.day += 1;
      return solve(ref) + 1;
    }
  }

  static class ref {
    boolean summer;
    int day;
    int k;

    ref(int k) {
      summer = true;
      day = 0;
      this.k = k;
    }
  }

  static class Gap implements Comparable<Gap> {
    int s, e;

    @Override
    public int compareTo(Gap other) {

      int res = Integer.compare(e - s, other.e - other.s);
      if (res == 0) {
        return Integer.compare(other.e, e);
      } else {
        return res;
      }
    }
  }

  class FastScanner {
    BufferedReader reader;
    StringTokenizer tokenizer;

    FastScanner() {
      reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
      tokenizer = null;
    }

    String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    int[] intArray(int size) {
      int[] ret = new int[size];
      for (int i = 0; i < size; i++) {
        ret[i] = nextInt();
      }
      return ret;
    }

    String[] stringArray(int size) {
      String[] ret = new String[size];
      for (int i = 0; i < size; i++) {
        ret[i] = next();
      }
      return ret;
    }
  }
}


import java.io.*;
import java.util.*;
public class Major {
    public static void main(String[] args)throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());
        int array[] = new int[n + 1];
        st = new StringTokenizer(br.readLine());
        ArrayList<Integer>list = new ArrayList<>();
        int cnt = 0;
        int prev = -1;
        for(int i = 1;i <= n;i++){
            array[i] = Integer.parseInt(st.nextToken());
            if(array[i] < 0){
                ++cnt;
                if(prev == -1){
                    prev = i;
                    continue;
                }
                list.add(i - prev - 1);
                prev = i;
            }
        }
        int left = k - cnt;
        if(left < 0){
            System.out.println("-1");
            return;
        }
        if(list.size() == 0 && prev == -1){
            System.out.println("0");
            return;
        }
        if(list.size() == 0){
            if(n - prev + 1 <= k)System.out.println("1");
            else System.out.println("2");
            return;
        }
        int ans = (list.size() + 1)*2;
        Collections.sort(list);
        //System.out.println(list);
        //System.out.println(left);
        cnt = 0;
        for(int temp : list){
            //System.out.println(temp);
            left -= temp;
            if(left >= 0)++cnt;
            else {
                left += temp;
                break;
            }
        }
        ans -= 2*cnt;
        if(n - prev <= left)--ans;
        //System.out.println(left + " " + cnt);
        System.out.println(ans);
    }
    }


import java.io.*;
import java.util.*;
public class Major {
    public static void main(String[] args)throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());
        int array[] = new int[n + 1];
        st = new StringTokenizer(br.readLine());
        ArrayList<Integer>list = new ArrayList<>();
        int cnt = 0;
        int prev = -1;
        for(int i = 1;i <= n;i++){
            array[i] = Integer.parseInt(st.nextToken());
            if(array[i] < 0){
                ++cnt;
                if(prev == -1){
                    prev = i;
                    continue;
                }
                list.add(i - prev - 1);
                prev = i;
            }
        }
        if(list.size() == 0 && prev == -1){
            System.out.println("0");
            return;
        }
        if(list.size() == 0){
            if(n - prev + 1 <= k)System.out.println("1");
            else System.out.println("2");
            return;
        }
        int ans = (list.size() + 1)*2;
        Collections.sort(list);
        //System.out.println(list);
        int left = k - cnt;
        if(left < 0){
            System.out.println("-1");
            return;
        }
        //System.out.println(left);
        cnt = 0;
        for(int temp : list){
            //System.out.println(temp);
            left -= temp;
            if(left >= 0)++cnt;
            else {
                left += temp;
                break;
            }
        }
        ans -= 2*cnt;
        if(n - prev <= left)--ans;
        //System.out.println(left + " " + cnt);
        System.out.println(ans);
    }
    }


import java.io.*;
import java.util.*;
public class Major {
    public static void main(String[] args)throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());
        int array[] = new int[n + 1];
        st = new StringTokenizer(br.readLine());
        ArrayList<Integer>list = new ArrayList<>();
        int cnt = 0;
        int prev = -1;
        for(int i = 1;i <= n;i++){
            array[i] = Integer.parseInt(st.nextToken());
            if(array[i] < 0){
                ++cnt;
                if(prev == -1){
                    prev = i;
                    continue;
                }
                list.add(i - prev - 1);
                prev = i;
            }
        }
        int left = k - cnt;
        if(left < 0){
            System.out.println("-1");
            return;
        }
        if(list.size() == 0 && prev == -1){
            System.out.println("0");
            return;
        }
        int ans = (list.size() + 1)*2;
        Collections.sort(list);
        //System.out.println(list);
        //System.out.println(left);
        cnt = 0;
        for(int temp : list){
            //System.out.println(temp);
            left -= temp;
            if(left >= 0)++cnt;
            else {
                left += temp;
                break;
            }
        }
        ans -= 2*cnt;
        if(n - prev <= left)--ans;
        //System.out.println(left + " " + cnt);
        System.out.println(ans);
    }
    }


import java.io.*;
import java.util.*;
public class Major {
    public static void main(String[] args)throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());
        int array[] = new int[n + 1];
        st = new StringTokenizer(br.readLine());
        ArrayList<Integer>list = new ArrayList<>();
        int cnt = 0;
        int prev = -1;
        for(int i = 1;i <= n;i++){
            array[i] = Integer.parseInt(st.nextToken());
            if(array[i] < 0){
                ++cnt;
                if(prev == -1){
                    prev = i;
                    continue;
                }
                list.add(i - prev - 1);
                prev = i;
            }
        }
        int ans = (list.size() + 1)*2;
        Collections.sort(list);
        //System.out.println(list);
        int left = k - cnt;
        if(left < 0){
            System.out.println("-1");
            return;
        }
        //System.out.println(left);
        cnt = 0;
        for(int temp : list){
            //System.out.println(temp);
            left -= temp;
            if(left >= 0)++cnt;
            else {
                left += temp;
                break;
            }
        }
        ans -= 2*cnt;
        if(n - prev <= left)--ans;
        //System.out.println(left + " " + cnt);
        System.out.println(ans);
    }
    }


import java.io.*;
import java.util.*;
public class Major {
    public static void main(String[] args)throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());
        int array[] = new int[n + 1];
        st = new StringTokenizer(br.readLine());
        ArrayList<Integer>list = new ArrayList<>();
        int cnt = 0;
        int prev = -1;
        for(int i = 1;i <= n;i++){
            array[i] = Integer.parseInt(st.nextToken());
            if(array[i] < 0){
                ++cnt;
                if(prev == -1){
                    prev = i;
                    continue;
                }
                list.add(i - prev - 1);
                prev = i;
            }
        }
        int ans = 0;
        if(list.size() > 0)
        ans = (list.size() + 1)*2;
        Collections.sort(list);
        //System.out.println(list);
        int left = k - cnt;
        if(left < 0){
            System.out.println("-1");
            return;
        }
        //System.out.println(left);
        cnt = 0;
        for(int temp : list){
            //System.out.println(temp);
            left -= temp;
            if(left >= 0)++cnt;
            else {
                left += temp;
                break;
            }
        }
        ans -= 2*cnt;
        if(n - prev <= left && prev != -1)--ans;
        //System.out.println(left + " " + cnt);
        System.out.println(ans);
    }
    }


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

import java.util.PriorityQueue;

public class Main {
  static int n, k;
  static int[] te;

  public static void main(String[] args){
    FastScanner sc = new FastScanner();

    n = sc.nextInt(); k = sc.nextInt();
    te = new int[n];
    for(int i = 0; i < n; i++){
      te[i] = sc.nextInt();
    }

    int count = 0;
    for(int i = 0; i < n; i++){
      if(te[i] < 0){
        ++count;
      }
    }

    if(count == 0){
      System.out.println(0);
      return;
    }

    if(count > k){
      System.out.println(-1);
      return;
    }

    k -= count;

    int segc = 0;
    if(te[0] < 0){
      ++segc;
    }
    for(int i = 1; i < n; i++){
      if(te[i - 1] >= 0 && te[i] < 0){
        ++segc;
      }
    }

    int ans = segc * 2;

    int s = 0;
    while(te[s] >= 0){
      ++s;
    }
    while(s < n && te[s] < 0){
      ++s;
    }

    PriorityQueue< Integer > pq = new PriorityQueue< >();
    while(s < n){
      int t = s + 1;
      while(t < n && te[t] >= 0){
        ++t;
      }
      if(t != n){
        pq.add((t - s));
      }
      while(t < n && te[t] < 0){
        ++t;
      }
      s = t;
    }

    while(!pq.isEmpty() && k - pq.peek() >= 0){
      k -= pq.poll();
      ans -= 2;
    }

    int t = n - 1;
    while(t >= 0 && te[t] >= 0){
      --t;
    }

    if(n - t - 1 <= k){
      --ans;
    }

    System.out.println(ans);
  }
}

class FastScanner {
  private static final InputStream in = System.in;
  private static final PrintWriter out = new PrintWriter(System.out);
  private final byte[] buffer = new byte[2048];
  private int p = 0;
  private int buflen = 0;

  public FastScanner(){
  }

  private boolean hasNextByte() {
    if(p < buflen){
      return true;
    }
    p = 0;
    try{
      buflen = in.read(buffer);
    }catch (IOException e) {
      e.printStackTrace();
    }
    if(buflen <= 0){
      return false;
    }
    return true;
  }

  public boolean hasNext() {
    while(hasNextByte() && !isPrint(buffer[p])){
      p++;
    }
    return hasNextByte();
  }

  private boolean isPrint(int ch) {
    if(ch >= '!' && ch <= '~'){
      return true;
    }
    return false;
  }

  private int nextByte() {
    if(!hasNextByte()){
      return -1;
    }
    return buffer[p++];
  }

  public String next() {
    if(!hasNext()){
      throw new NoSuchElementException();
    }
    StringBuilder sb = new StringBuilder();
    int b = -1;
    while(isPrint((b = nextByte()))){
      sb.appendCodePoint(b);
    }
    return sb.toString();
  }

  public int nextInt() {
    return Integer.parseInt(next());
  }

  public long nextLong() {
    return Long.parseLong(next());
  }

  public double nextDouble() {
    return Double.parseDouble(next());
  }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    FastScanner in;
    PrintWriter out;
    char[] s;

    // swaps two adjacent elements
    private void swapAdjacent(int cur, int index) {
    	char tmp;
    	for(int i=index ; i>cur ; i--) {
    		tmp = s[i-1];
    		s[i-1] = s[i];
    		s[i] = tmp;
    	}
    }

    // 1519 1181 848

    void solve() {
    	int n = in.nextInt();
    	int k = in.nextInt();
    	int[] arr = new int[n];
    	ArrayList<Integer> indices = new ArrayList<Integer>();
    	int count = 0;
    	boolean flag2 = false;
    	for(int i=0 ; i<n ; i++) {
    		arr[i] = in.nextInt();
    		if(arr[i] < 0) {
    			indices.add(i); // 1 6 7
    			k--; // 3
    			count += 2; // 3
    			if(!flag2)
    				count--; //
    			if(i != 0 && arr[i-1] < 0)
    				count -= 2;
    			flag2 = true;
    		}
    	}

    	if(k < 0) {
    		out.println(-1);
    		return ;
    	}

    	if(indices.size() == 0) {
    		out.println(0);
    		return ;
    	}
    	if(arr[n-1] >= 0) {
    		count++; // 4
    		indices.add(n); // 1 6 7 10
    	}

    	int tmp = 500000;
    	ArrayList<Integer> l = new ArrayList<Integer>();
    	for(int i=0 ; i<indices.size()-1 ; i++) {
    		l.add(indices.get(i+1)-indices.get(i)-1); // 4 0 2
    		if(i == indices.size()-2)
    			tmp = indices.get(i+1)-indices.get(i)-1; // 2
    	}
    	boolean flag = false;
    	Collections.sort(l); // 0 2 4
    	for(int i=0 ; i<l.size() ; i++) {
    		if(l.get(i) <= k) {
    			if(l.get(i) == tmp && !flag) {
    				flag = true;
    				continue;
    			}
    			if(l.get(i) == 0)
    				continue;
    			k -= l.get(i);
    			count -= 2;
    		} else
    			break;
    	}
		if(tmp <= k)
			count--;
    	out.println(count);
    }

    void runIO() {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    void run() {
        try {
            in = new FastScanner(new File("test.in"));
            out = new PrintWriter(new File("test.out"));

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        String nextln() {
        	String s = null;
            while (st == null || !st.hasMoreTokens()) {
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return s;
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    public static void main(String[] args) {
        new Main().runIO();
    }
}

class Pair {
    int first;
    int second;

    Pair(int first, int second) {
        this.first = first;
        this.second = second;
    }
}

class Node {
	int value;
	ArrayList<Integer> edges = new ArrayList<Integer>();

	Node(int v) {
		this.value = v;
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    FastScanner in;
    PrintWriter out;
    char[] s;

    // swaps two adjacent elements
    private void swapAdjacent(int cur, int index) {
    	char tmp;
    	for(int i=index ; i>cur ; i--) {
    		tmp = s[i-1];
    		s[i-1] = s[i];
    		s[i] = tmp;
    	}
    }

    // 1519 1181 848

    void solve() {
    	int n = in.nextInt();
    	int k = in.nextInt();
    	int[] arr = new int[n];
    	ArrayList<Integer> indices = new ArrayList<Integer>();
    	int count = 0;
    	boolean flag2 = false;
    	for(int i=0 ; i<n ; i++) {
    		arr[i] = in.nextInt();
    		if(arr[i] < 0) {
    			indices.add(i); // 1 6 7
    			k--; // 3
    			count += 2; // 3
    			if(!flag2)
    				count--; //
    			if(i != 0 && arr[i-1] < 0)
    				count -= 2;
    			flag2 = true;
    		}
    	}

    	if(k < 0) {
    		out.println(-1);
    		return ;
    	}

    	if(indices.size() == 0) {
    		out.println(0);
    		return ;
    	}
    	if(arr[n-1] >= 0) {
    		count++; // 4
    		indices.add(n); // 1 6 7 10
    	}

    	int tmp = 500000;
    	ArrayList<Integer> l = new ArrayList<Integer>();
    	for(int i=0 ; i<indices.size()-1 ; i++) {
    		l.add(indices.get(i+1)-indices.get(i)-1); // 4 0 2
    		if(i == indices.size()-2)
    			tmp = indices.get(i+1)-indices.get(i)-1; // 2
    	}
    	boolean flag = false;
    	Collections.sort(l); // 0 2 4
    	for(int i=0 ; i<l.size() ; i++) {
    		if(l.get(i) <= k) {
    			if(l.get(i) == tmp && !flag) {
    				flag = true;
    				continue;
    			}
    			if(l.get(i) == 0)
    				continue;
    			k -= l.get(i);
    			count -= 2;
    		} else
    			break;
    	}
		if(tmp <= k && tmp != 0)
			count--;
    	out.println(count);
    }

    void runIO() {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    void run() {
        try {
            in = new FastScanner(new File("test.in"));
            out = new PrintWriter(new File("test.out"));

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        String nextln() {
        	String s = null;
            while (st == null || !st.hasMoreTokens()) {
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return s;
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    public static void main(String[] args) {
        new Main().runIO();
    }
}

class Pair {
    int first;
    int second;

    Pair(int first, int second) {
        this.first = first;
        this.second = second;
    }
}

class Node {
	int value;
	ArrayList<Integer> edges = new ArrayList<Integer>();

	Node(int v) {
		this.value = v;
	}
}


import java.io.*;
import java.util.*;

public class D {
    public static void main(String[]args) throws IOException {
        BufferedReader x = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(x.readLine());
        int n = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());
        int left = k;
        int[] arr = new int[n];
        st = new StringTokenizer(x.readLine());
        boolean hasNeg = false;
        boolean neg = false;
        int numChunks = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
            if (arr[i] < 0) {
                left--;
                hasNeg = true;
                if (!neg) {
                    numChunks++;
                    neg = true;
                }
            } else {
                neg = false;
            }
        }
        if (left < 0) {
            System.out.println("-1");
            System.exit(0);
        }
        if (!hasNeg) {
            System.out.println("0");
            System.exit(0);
        }
        ArrayList<Integer> gaps = new ArrayList<Integer>();
        int index = 0;
        while (index < n && arr[index] >= 0) {//first positive chunk
            index++;
        }
        while (index < n && arr[index] < 0) {//first negative chunk
            index++;
        }
        if (index == n) {
            System.out.println("1");
            System.exit(0);
        }
        int end = 0;
        int cur = 0;
        for (int i = index; i < n; i++) {
            if (arr[i] >= 0) {
                while (i < n && arr[i] >= 0) {
                    cur++;
                    i++;
                }
                if (i == n) {
                    end = cur;
                } else {
                    gaps.add(cur);
                }
                cur = 0;
            }
        }
        int ans = 2 * numChunks;
        Collections.sort(gaps);
        int id = 0;
        while (id < gaps.size() && left - gaps.get(id) >= 0) {
            left -= gaps.get(id);
            ans -= 2;
            id++;
        }
        if (left >= end) {
            ans--;
        }
        System.out.println(ans);
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Wolfgang Beyer
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] a = in.readIntArray(n);

            List<Integer> summerLengths = new ArrayList<>();
            int winterDays = 0;
            int switches = 0;

            int first = 0;
            while ((first < n) && (a[first] >= 0)) first++;
            if (first == 0) {
                winterDays++;
                switches++;
                first = 1;
            }

            int last = n - 1;
            while ((last >= 0) && (a[last] >= 0)) last--;

            int currentStreak = 0;
            for (int i = first; i < n; i++) {
                if (a[i] < 0) {
                    winterDays++;
                    if (a[i - 1] >= 0) switches++;
                    if (currentStreak > 0) summerLengths.add(currentStreak);
                    currentStreak = 0;
                } else {
                    currentStreak++;
                    if (a[i - 1] < 0) switches++;
                }
            }
            //if (currentStreak > 0) summerLengths.add(currentStreak);

            if (k < winterDays) {
                out.println(-1);
                return;
            }

            k -= winterDays;
            Collections.sort(summerLengths);
            int index = 0;
            while ((index < summerLengths.size()) && (summerLengths.get(index) <= k)) {
                k -= summerLengths.get(index);
                switches -= 2;
                index++;
            }
            if ((currentStreak > 0) && (currentStreak <= k)) switches--;
            out.println(switches);
        }

    }

    static class InputReader {
        private static BufferedReader in;
        private static StringTokenizer tok;

        public InputReader(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int[] readIntArray(int n) {
            int[] ar = new int[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }

        public String next() {
            try {
                while (tok == null || !tok.hasMoreTokens()) {
                    tok = new StringTokenizer(in.readLine());
                }
            } catch (IOException ex) {
                System.err.println("An IOException was caught :" + ex.getMessage());
            }
            return tok.nextToken();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Wolfgang Beyer
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] a = in.readIntArray(n);

            List<Integer> summerLengths = new ArrayList<>();
            int winterDays = 0;
            int switches = 0;

            int first = 0;
            while ((first < n) && (a[first] >= 0)) first++;
            if (first == 0) {
                winterDays++;
                switches++;
                first = 1;
            }

            int last = n - 1;
            while ((last >= 0) && (a[last] >= 0)) last--;

            int currentStreak = 0;
            for (int i = first; i < n; i++) {
                if (a[i] < 0) {
                    winterDays++;
                    if (a[i - 1] >= 0) switches++;
                    if (currentStreak > 0) summerLengths.add(currentStreak);
                    currentStreak = 0;
                } else {
                    currentStreak++;
                    if (a[i - 1] < 0) switches++;
                }
            }
            //if (currentStreak > 0) summerLengths.add(currentStreak);

            if (k < winterDays) {
                out.println(-1);
                return;
            }

            k -= winterDays;
            Collections.sort(summerLengths);
            int index = 0;
            while ((index < summerLengths.size()) && (summerLengths.get(index) <= k)) {
                k -= summerLengths.get(index);
                switches -= 2;
                index++;
            }
            if (currentStreak <= k) switches--;
            out.println(switches);
        }

    }

    static class InputReader {
        private static BufferedReader in;
        private static StringTokenizer tok;

        public InputReader(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int[] readIntArray(int n) {
            int[] ar = new int[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }

        public String next() {
            try {
                while (tok == null || !tok.hasMoreTokens()) {
                    tok = new StringTokenizer(in.readLine());
                }
            } catch (IOException ex) {
                System.err.println("An IOException was caught :" + ex.getMessage());
            }
            return tok.nextToken();
        }

    }
}


import java.io.*;
import java.util.*;

public class Template implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine(), " :");
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    <T> List<T>[] createGraphList(int size) {
        List<T>[] list = new List[size];
        for (int i = 0; i < size; i++) {
            list[i] = new ArrayList<>();
        }
        return list;
    }

    public static void main(String[] args) {
        new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    class Segment implements Comparable<Segment> {
        int l, r;

        public Segment(int l, int r) {
            this.l = l;
            this.r = r;
        }

        int len() {
            return r - l;
        }

        @Override
        public int compareTo(Segment o) {
            return -len() + o.len();
        }
    }

    int solve(int n, List<Segment> list, PriorityQueue<Segment> pq, boolean useStart, boolean useEnd, int needPositive) {
        list = new ArrayList<>(list);
        pq = new PriorityQueue<>(pq);

        boolean[] positive = new boolean[n];
        int positiveCount = 0;
        if (useStart && list.size() > 0 && list.get(0).l == 0) {
            Segment first = list.get(0);
            for (int i = first.l; i <= first.r; i++) {
                positive[i] = true;
            }
        }
        if (useEnd && list.size() > 0 && list.get(list.size() - 1).r == n - 1) {
            Segment last = list.get(list.size() - 1);
            for (int i = last.l; i <= last.r; i++) {
                positive[i] = true;
            }
        }

        for (boolean x : positive) {
            if (x) positiveCount++;
        }
        while (needPositive > positiveCount && pq.size() > 0) {
            Segment large = pq.poll();
            for (int i = large.l; i <= large.r; i++) positive[i] = true;
            positiveCount += large.r - large.l + 1;
        }
        if (needPositive > positiveCount) return Integer.MAX_VALUE;
        boolean cur = true;
        int answer = 0;
        for (boolean x : positive) {
            if (x == cur) continue;
            cur ^= true;
            answer++;
        }
        return answer;
    }

    void solve() throws IOException {
        int n = readInt();
        int k = readInt();
        int[] a = readIntArray(n);
        int neg = 0;
        for (int x : a) {
            if (x < 0) neg++;
        }
        if (neg > k) {
            out.println(-1);
            return;
        }

        List<Segment> list = new ArrayList<>();
        PriorityQueue<Segment> pq = new PriorityQueue<>();
        for (int i = 0; i < n; i++) {
            if (a[i] >= 0) {
                int cur = i;
                while (cur < n && a[cur] >= 0) {
                    cur++;
                }
                if (i != 0 && cur - 1 != n - 1) {
                    pq.add(new Segment(i, cur - 1));
                }

                list.add(new Segment(i, cur - 1));
                i = cur - 1;
            }
        }
        if (neg == 0) {
            out.println(0);
            return;
        }

        int ans1 = Math.min(solve(n, list, pq, false, false, n - k), solve(n, list, pq, false, true, n - k));
        int ans2 = Math.min(solve(n, list, pq, true, false, n - k), solve(n, list, pq, true, true, n - k));
        int ans = Math.min(ans1, ans2);
        out.println(ans);

    }

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class D {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int k = sc.nextInt();
		int ans = 0;
		int a[] = new int[n];
		ArrayList<Integer> summerInterval = new ArrayList<>();
		int pointer = -1;

		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
			if (a[i] < 0 && pointer == -1){
				pointer = i;
				ans++;

			}
		}

		int summerPointer = 0;
		for (int i = pointer; i < a.length; i++) {
			if (a[i] < 0) {
				k--;
				if(k < 0)
				{
					System.out.println(-1);
					return ;

				}
				if (summerPointer != 0) {
					summerInterval.add(summerPointer);
					summerPointer = 0;
				}
			} else {
				summerPointer++;

			}
		}

		Collections.sort(summerInterval);
		while(summerInterval.size() > 0){
			if(k >= summerInterval.get(0)){
				k -= summerInterval.remove(0);

			}else
				break;
		}
		ans += summerInterval.size()*2;
		if(summerPointer > 0 && summerPointer > k)
			ans++;
		System.out.println(ans);

	}

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class D {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int k = sc.nextInt();
		int ans = 0;
		int a[] = new int[n];
		ArrayList<Integer> summerInterval = new ArrayList<>();
		int pointer = -1;

		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
			if (a[i] < 0 && pointer == -1){
				pointer = i;
				ans++;

			}
		}
		if(pointer == -1)
		{
			System.out.println(0);
			return;

		}
		int summerPointer = 0;
		for (int i = pointer; i < a.length; i++) {
			if (a[i] < 0) {
				k--;
				if(k < 0)
				{
					System.out.println(-1);
					return ;

				}
				if (summerPointer != 0) {
					summerInterval.add(summerPointer);
					summerPointer = 0;
				}
			} else {
				summerPointer++;

			}
		}

		Collections.sort(summerInterval);
		while(summerInterval.size() > 0){
			if(k >= summerInterval.get(0)){
				k -= summerInterval.remove(0);

			}else
				break;
		}
		ans += summerInterval.size()*2;
		if(summerPointer > 0 && summerPointer > k)
			ans++;
		System.out.println(ans);

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException, InterruptedException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskC {
		static boolean visited[]  ;
		static boolean found = false;

		static int steps = 0 ;
		static int n ;
		static boolean memo [][] ;
		static int dp[][] ;
		static char matrix[][] ;
		static ArrayList<Integer> p  ;
		public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException, InterruptedException {

			int n = in.nextInt() ;
			int k =in.nextInt() ;

			int a[] =  new int[n] ;
			int c=0 ;
			for (int i = 0; i < a.length; i++)
			{
				a[i]=in.nextInt();
				if(a[i]<0)
					c++;
			}

			if(c==0)
			{
				System.out.println(0);
				return ;
			}
			if(k==0)
			{
				System.out.println(-1);
				return ;
			}

			if(k<c)
				System.out.println(-1);
			else if (k==c)
			{
				int changes=0 ;
				boolean summer= true ;
				for (int i = 0; i < a.length; i++)
					if(a[i]<0 && summer)
					{
						changes ++;
						summer = false ;
					}else if (a[i]>=0 && !summer)
					{
						changes ++ ;
						summer = true ;
					}else continue ;

				System.out.println(changes);
			}
			else
			{
				int x=k-c ;
				int begin =0 ;
				for (int i = 0; i < a.length; i++)
					if(a[i]<0){begin = i ; break ;}
				ArrayList<pair2> pos = new ArrayList<pair2>() ;

				for (int i = begin; i < a.length; i++)
				{
					if(a[i]>=0)
					{
						int d=1 ;
						int end = i+1 ;
						for (int j = i+1; j < a.length; j++)
						{
							if(a[j]>=0){d++; end = j ;} else {end =j ; break ;}
						}
						pair2 now = new pair2(d,false) ;
						if(end ==n || end==n-1) now.last=true ;
						pos.add(now);
						i=end ;
					}
				}

				System.err.println("pos");
				for (int i = 0; i < pos.size(); i++)
				{
					System.err.println(pos.get(i).i+" "+pos.get(i).last);
				}
				Collections.sort(pos);
				System.err.println("pos");

				int min1 =0 ;
				int min2 =0 ;

				int xx =x ;
				System.err.println(x+"x");
				for (int i = 0; i < pos.size(); i++)
				{
					if(x>=pos.get(i).i)
					{
						min1 +=2 ;
						x-=pos.get(i).i ;
						if(pos.get(i).last==true) min1--;
					}
				}
				for (int i = 0; i < pos.size(); i++)
				{
					if(xx>=pos.get(i).i && pos.get(i).last==false)
					{
						min2+=2 ;
						xx-=pos.get(i).i ;
					}
				}
				System.err.println("com mins");
				System.err.println(min2);
				System.err.println(min1);
				min1 = Math.max(min1, min2) ;

				int changes=0 ;
				boolean summer= true ;
				for (int i = 0; i < a.length; i++)
					if(a[i]<0 && summer)
					{
						changes ++;
						summer = false ;
					}else if (a[i]>=0 && !summer)
					{
						changes ++ ;
						summer = true ;
					}else continue ;

				System.err.println(changes);
				changes -= min1 ;
				System.out.println(changes);

			}

			//				int rem= k  ;
			//				int need[] =  new int[n] ;
			//
			//				if(a[n-1]<0) need[n-1]=1 ;
			//				else need[n-1]=0 ;
			//
			//				for (int i = n-2; i >=0; i--)
			//				{
			//					if(a[i]<0)need[i]=need[i+1]+1 ;
			//					else need[i]=need[i+1] ;
			//
			//					//System.err.println(a[i]+"AA"+need[i]);
			//				}
			//
			//				for (int i = 0; i < need.length; i++)
			//				{
			//					System.err.print(need[i]+" ");
			//				}
			//				boolean summer= true ;
			//				int changes =0 ;
			//
			//				if(a[0]<0){summer = false ; rem -- ; changes++ ;}
			//
			//				for (int i = 1; i < n; i++)
			//				{
			//					if(a[i]<0 && summer)
			//					{
			//						changes ++ ;
			//						System.err.println("her"+i);
			//						summer = false  ;
			//						rem -- ;
			//					}else if(a[i]<0 && !summer){ rem -- ;}
			//					else if (a[i]>=0 && summer){continue ; }
			//					else {
			//						if(rem > need[i])
			//						{
			//							rem-- ;
			//						}else {summer = true ; changes ++ ; System.err.println("h"+i); }
			//					}
			//				}
			//
			//				System.out.println(changes);

		}

		public static int cnt1(int mat[][])  //how many swaps to be a 1 matrix
		{
			int m = mat.length ;
			int c=0 ;
			for (int i = 0; i < mat.length; i++)
			{
				for (int j = 0; j < mat.length; j++)
				{
					int x =  (i*m) +j ;
					if(x%2==0 && mat[i][j]==0)
						c++;
					if(x%2!=0 && mat[i][j]==1)
						c++;

				}
			}
			return c;
		}
		public static int cnt0(int mat[][])
		{
			int m = mat.length ;
			int c=0 ;
			for (int i = 0; i < mat.length; i++)
			{
				for (int j = 0; j < mat.length; j++)
				{
					int x =  (i*m) +j ;
					if(x%2!=0 && mat[i][j]==0)
						c++;
					if(x%2==0 && mat[i][j]==1)
						c++;

				}
			}
			return c;
		}

		public static boolean canFit2(int x1, int y1 , int x2 , int y2 , int x3 , int y3){
			if(x1==x2)
				if(x1==x3)
					return true ;
				else
					return false ;
			else
				if(x1==x3)
					return false ;
				else
				{
					long a = 1l*(y2-y1)*(x3-x2) ;
					long b = 1l*(y3-y2)*(x2-x1) ;

					if(a==b)
						return true;
					else
						return false ;

				}

		}
		public static void shuffle(int c[]){
			if(c.length==1)
				return ;
			for (int i = 0; i < c.length; i++)
			{
				Random rand = new Random();

				int  n = rand.nextInt(c.length-1) + 0;

				int temp = c[i] ;
				c[i] = c[n] ;
				c[n] = temp ;
			}
		}
		public static int binary(long[]arr, int l, int r, long x)   /// begin by 0 and n-1
		{
			if (r>=l)
			{
				int mid = l + (r - l)/2;
				if (arr[mid]== x)
					return mid;
				if (arr[mid]> x)
					return binary(arr, l, mid-1, x);
				return binary(arr, mid+1, r, x);
			}
			return -1;
		}

		/// searching for the index of first elment greater than x
		public static int binary1(long[]arr , long x) {
			int low = 0, high = arr.length; // numElems is the size of the array i.e arr.size()
			while (low != high) {
				int mid = (low + high) / 2; // Or a fancy way to avoid int overflow
				if (arr[mid] <= x) {
					/* This index, and everything below it, must not be the first element
					 * greater than what we're looking for because this element is no greater
					 * than the element.
					 */
					low = mid + 1;
				}
				else {
					/* This element is at least as large as the element, so anything after it can't
					 * be the first element that's at least as large.
					 */
					high = mid;
				}
			}
			return low ; // return high ;
		}

		private static boolean triangle(int a, int b , int c){
			if(a+b>c && a+c>b && b+c>a)
				return true ;
			else
				return false ;
		}
		private static boolean segment(int a, int b , int c){
			if(a+b==c || a+c==b && b+c==a)
				return true ;
			else
				return false ;
		}
		private static int gcdThing(long a, long b) {
			BigInteger b1 = BigInteger.valueOf(a);
			BigInteger b2 = BigInteger.valueOf(b);
			BigInteger gcd = b1.gcd(b2);
			return gcd.intValue();
		}

		public static boolean is(int i){
			if(Math.log(i)/ Math.log(2) ==(int) (Math.log(i)/ Math.log(2)))
				return true ;
			if(Math.log(i)/ Math.log(3) ==(int) (Math.log(i)/ Math.log(3)) )
				return true ;
			if(Math.log(i)/ Math.log(6) ==(int) (Math.log(i)/ Math.log(6)) )
				return true ;

			return false;

		}
		public static boolean contains(int b[] , int x)
		{
			for (int i = 0; i < b.length; i++)
			{
				if(b[i]==x)
					return true ;
			}
			return false ;
		}
		public static int binary(long []arr , long target , int low , long shift) {
			int high = arr.length;
			while (low != high) {
				int mid = (low + high) / 2;
				if (arr[mid]-shift <= target) {
					low = mid + 1;
				}
				else {
					high = mid;
				}
			}
			return low ; // return high ;
		}
		public static boolean isLetter(char x){
			if(x+0 <=122 && x+0 >=97 )
				return true ;
			else if (x+0 <=90 && x+0 >=65 )
				return true ;
			else return false;
		}
		public static long getPrimes(long x ){
			if(x==2 || x==3 || x==1)
				return 2 ;
			if(isPrime(x))
				return 5 ;
			for (int i = 2; i*i<=x; i++)
			{
				if(x%i==0 && isPrime(i))
					return getPrimes(x/i) ;
			}
			return -1;
		}
		public static String solve(String x){

			int n = x.length() ;
			String y = "" ;
			for (int i = 0; i < n-2; i+=2)
			{
				if(ifPalindrome(x.substring(i, i+2)))
					y+= x.substring(i, i+2) ;
				else
					break ;
			}
			return y+ solve1(x.substring(y.length(),x.length())) ;

		}
		public static String solve1(String x){
			String y = x.substring(0 , x.length()/2) ;
			return "" ;

		}
		public static String reverse(String x){
			String y ="" ;
			for (int i = 0; i < x.length(); i++)
			{
				y  = x.charAt(i) + y ;
			}
			return y ;
		}

		public static boolean ifPalindrome(String x){
			int numbers[] = new int[10] ;
			for (int i = 0; i < x.length(); i++)
			{
				int z = Integer.parseInt(x.charAt(i)+"") ;
				numbers[z] ++ ;
			}
			for (int i = 0; i < numbers.length; i++)
			{
				if(numbers[i]%2!=0)
					return false;
			}
			return true ;
		}

		public static int get(int n){
			return n*(n+1)/2 ;
		}
		//		public static long getSmallestDivisor( long y){
		//			if(isPrime(y))
		//				return -1;
		//
		//			for (long i = 2; i*i <= y; i++)
		//			{
		//				if(y%i ==0)
		//				{
		//					return i;
		//				}
		//			}
		//			return -1;
		//		}
		//		public static void lis(pair []a , int n){
		//			int lis[] = new int[n] ;
		//			Arrays.fill(lis,1) ;
		//
		//			for(int i=1;i<n;i++)
		//				for(int j=0 ; j<i; j++)
		//					if (a[i].y>a[j].y &&  lis[i] < lis[j]+1)
		//						lis[i] = lis[j] + 1;
		//
		//			int max = lis[0];
		//
		//			for(int i=1; i<n ; i++)
		//				if (max < lis[i])
		//					max = lis[i] ;
		//			System.out.println(max);
		//
		//			ArrayList<Integer> s = new ArrayList<Integer>() ;
		//			for (int i = n-1; i >=0; i--)
		//			{
		//				if(lis[i]==max)
		//				{
		//					s.add(a[i].z);
		//					max --;
		//				}
		//			}
		//
		//			for (int i = s.size()-1 ; i>=0 ;  i--)
		//			{
		//				System.out.print(s.get(i)+" ");
		//			}
		//
		//			return  ;
		//		}
		public static int calcDepth(Vertix node){
			if(node.depth>0) return node.depth;
			// meaning it has been updated before;
			if(node.parent != null)
				return 1+ calcDepth(node.parent);
			else
				return -1;
		}

		public static boolean isPrime (long num){
			if (num < 2) return false;
			if (num == 2) return true;
			if (num % 2 == 0) return false;
			for (int i = 3; i * i <= num; i += 2)
				if (num % i == 0) return false;
			return true;
		}

		public static int[] getDiv(int n)
		{
			int result[] = new int[7] ;
			ArrayList<Integer>  f = new ArrayList<Integer>() ;

			while (n%2==0)
			{
				if(!f.contains(2))f.add(2) ;
				n /= 2;
			}

			// n must be odd at this point.  So we can
			// skip one element (Note i = i +2)
			for (int i = 3; i <= Math.sqrt(n); i+= 2)
			{
				// While i divides n, print i and divide n
				while (n%i == 0)
				{
					if(!f.contains(i))f.add(i);
					n /= i;
				}
			}

			// This condition is to handle the case whien
			// n is a prime number greater than 2
			if (n > 2)
				if(!f.contains(n))f.add(n);

			for (int i = 0, j=0; i < f.size(); i++)
			{
				result[j++]=f.get(i);
			}
			return result ;

		}

		//		public static boolean dfs(Vertix v , int target){
		//			try{
		//				visited[v.i]= true ;
		//			} catch (NullPointerException e)
		//			{
		//				System.out.println(v.i);
		//			}
		//			if(v.i == target)
		//
		//				return true ;
		//			for (int i =0 ; i< v.neighbours.size() ; i++)
		//			{
		//
		//				Vertix child = v.neighbours.get(i) ;
		//				if(child.i == target){
		//					found = true  ;
		//				}
		//				if(visited[child.i]==false){
		//					found |= dfs(child, target) ;
		//				}
		//			}
		//			return found;
		//		}

	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
	public static class Vertix{
		long i ;
		int depth ;
		ArrayList<Vertix> neighbours ;
		Vertix parent ;
		Vertix child ;

		public Vertix(long i){
			this.i = i ;
			this.neighbours = new ArrayList<Vertix> () ;
			this.parent = null ;
			depth =-1;
			this.child = null ;
		}
	}

	public static class pair implements Comparable<pair>{
		int i ;
		int r ;
		int qless  ; /// is his quarrel has skill less than him

		public pair(int x, int y ,int z){
			this.i=x ;
			this.r=y ;
			this .qless =z ;

		}

		@Override
		public int compareTo(pair p) {
			if(this.r > p.r)
				return 1 ;
			else if(this.r == p.r) return 0 ;
			else return -1 ;

		}

	}

	public static class pair2 implements Comparable<pair2>{
		int i ;
		boolean last ;

		public pair2(int i , boolean result){
			this.i =i ;
			this.last = result ;
		}

		@Override
		public int compareTo(pair2 p) {
			if(this.i > p.i)
				return 1 ;
			else if (this.i == p.i) return 0 ;
			else
				return -1 ;
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException, InterruptedException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskC {
		static boolean visited[]  ;
		static boolean found = false;

		static int steps = 0 ;
		static int n ;
		static boolean memo [][] ;
		static int dp[][] ;
		static char matrix[][] ;
		static ArrayList<Integer> p  ;
		public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException, InterruptedException {

			int n = in.nextInt() ;
			int k =in.nextInt() ;

			int a[] =  new int[n] ;
			int c=0 ;
			for (int i = 0; i < a.length; i++)
			{
				a[i]=in.nextInt();
				if(a[i]<0)
					c++;
			}

			if(c==0)
			{
				System.out.println(0);
				return ;
			}
			if(k==0)
			{
				System.out.println(-1);
				return ;
			}

			if(k<c)
				System.out.println(-1);
			else if (k==c)
			{
				int changes=0 ;
				boolean summer= true ;
				for (int i = 0; i < a.length; i++)
					if(a[i]<0 && summer)
					{
						changes ++;
						summer = false ;
					}else if (a[i]>=0 && !summer)
					{
						changes ++ ;
						summer = true ;
					}else continue ;

				System.out.println(changes);
			}
			else
			{
				int x=k-c ;
				int begin =0 ;
				for (int i = 0; i < a.length; i++)
					if(a[i]<0){begin = i ; break ;}
				ArrayList<pair2> pos = new ArrayList<pair2>() ;

				for (int i = begin; i < a.length; i++)
				{
					if(a[i]>=0)
					{
						int d=1 ;
						int end = i+1 ;
						for (int j = i+1; j < a.length; j++)
						{
							if(a[j]>=0){d++; end = j+1 ;} else {end =j ; break ;}
						}
						pair2 now = new pair2(d,false) ;
						if(end ==n || end==n-1) now.last=true ;
						pos.add(now);
						i=end ;
					}
				}

				System.err.println("pos");
				for (int i = 0; i < pos.size(); i++)
				{
					System.err.println(pos.get(i).i+" "+pos.get(i).last);
				}
				Collections.sort(pos);
				System.err.println("pos");

				int min1 =0 ;
				int min2 =0 ;

				int xx =x ;
				System.err.println(x+"x");
				for (int i = 0; i < pos.size(); i++)
				{
					if(x>=pos.get(i).i)
					{
						min1 +=2 ;
						x-=pos.get(i).i ;
						if(pos.get(i).last==true) min1--;
					}else {break;}
				}
				for (int i = 0; i < pos.size(); i++)
				{
					if(xx>=pos.get(i).i && pos.get(i).last==false)
					{
						min2+=2 ;
						xx-=pos.get(i).i ;
					}else {break;}
				}
				System.err.println("com mins");
				System.err.println(min2);
				System.err.println(min1);
				min1 = Math.max(min1, min2) ;

				int changes=0 ;
				boolean summer= true ;
				for (int i = 0; i < a.length; i++)
					if(a[i]<0 && summer)
					{
						changes ++;
						summer = false ;
					}else if (a[i]>=0 && !summer)
					{
						changes ++ ;
						summer = true ;
					}else continue ;

				System.err.println(changes);
				changes -= min1 ;
				System.out.println(changes);

			}

			//				int rem= k  ;
			//				int need[] =  new int[n] ;
			//
			//				if(a[n-1]<0) need[n-1]=1 ;
			//				else need[n-1]=0 ;
			//
			//				for (int i = n-2; i >=0; i--)
			//				{
			//					if(a[i]<0)need[i]=need[i+1]+1 ;
			//					else need[i]=need[i+1] ;
			//
			//					//System.err.println(a[i]+"AA"+need[i]);
			//				}
			//
			//				for (int i = 0; i < need.length; i++)
			//				{
			//					System.err.print(need[i]+" ");
			//				}
			//				boolean summer= true ;
			//				int changes =0 ;
			//
			//				if(a[0]<0){summer = false ; rem -- ; changes++ ;}
			//
			//				for (int i = 1; i < n; i++)
			//				{
			//					if(a[i]<0 && summer)
			//					{
			//						changes ++ ;
			//						System.err.println("her"+i);
			//						summer = false  ;
			//						rem -- ;
			//					}else if(a[i]<0 && !summer){ rem -- ;}
			//					else if (a[i]>=0 && summer){continue ; }
			//					else {
			//						if(rem > need[i])
			//						{
			//							rem-- ;
			//						}else {summer = true ; changes ++ ; System.err.println("h"+i); }
			//					}
			//				}
			//
			//				System.out.println(changes);

		}

		public static int cnt1(int mat[][])  //how many swaps to be a 1 matrix
		{
			int m = mat.length ;
			int c=0 ;
			for (int i = 0; i < mat.length; i++)
			{
				for (int j = 0; j < mat.length; j++)
				{
					int x =  (i*m) +j ;
					if(x%2==0 && mat[i][j]==0)
						c++;
					if(x%2!=0 && mat[i][j]==1)
						c++;

				}
			}
			return c;
		}
		public static int cnt0(int mat[][])
		{
			int m = mat.length ;
			int c=0 ;
			for (int i = 0; i < mat.length; i++)
			{
				for (int j = 0; j < mat.length; j++)
				{
					int x =  (i*m) +j ;
					if(x%2!=0 && mat[i][j]==0)
						c++;
					if(x%2==0 && mat[i][j]==1)
						c++;

				}
			}
			return c;
		}

		public static boolean canFit2(int x1, int y1 , int x2 , int y2 , int x3 , int y3){
			if(x1==x2)
				if(x1==x3)
					return true ;
				else
					return false ;
			else
				if(x1==x3)
					return false ;
				else
				{
					long a = 1l*(y2-y1)*(x3-x2) ;
					long b = 1l*(y3-y2)*(x2-x1) ;

					if(a==b)
						return true;
					else
						return false ;

				}

		}
		public static void shuffle(int c[]){
			if(c.length==1)
				return ;
			for (int i = 0; i < c.length; i++)
			{
				Random rand = new Random();

				int  n = rand.nextInt(c.length-1) + 0;

				int temp = c[i] ;
				c[i] = c[n] ;
				c[n] = temp ;
			}
		}
		public static int binary(long[]arr, int l, int r, long x)   /// begin by 0 and n-1
		{
			if (r>=l)
			{
				int mid = l + (r - l)/2;
				if (arr[mid]== x)
					return mid;
				if (arr[mid]> x)
					return binary(arr, l, mid-1, x);
				return binary(arr, mid+1, r, x);
			}
			return -1;
		}

		/// searching for the index of first elment greater than x
		public static int binary1(long[]arr , long x) {
			int low = 0, high = arr.length; // numElems is the size of the array i.e arr.size()
			while (low != high) {
				int mid = (low + high) / 2; // Or a fancy way to avoid int overflow
				if (arr[mid] <= x) {
					/* This index, and everything below it, must not be the first element
					 * greater than what we're looking for because this element is no greater
					 * than the element.
					 */
					low = mid + 1;
				}
				else {
					/* This element is at least as large as the element, so anything after it can't
					 * be the first element that's at least as large.
					 */
					high = mid;
				}
			}
			return low ; // return high ;
		}

		private static boolean triangle(int a, int b , int c){
			if(a+b>c && a+c>b && b+c>a)
				return true ;
			else
				return false ;
		}
		private static boolean segment(int a, int b , int c){
			if(a+b==c || a+c==b && b+c==a)
				return true ;
			else
				return false ;
		}
		private static int gcdThing(long a, long b) {
			BigInteger b1 = BigInteger.valueOf(a);
			BigInteger b2 = BigInteger.valueOf(b);
			BigInteger gcd = b1.gcd(b2);
			return gcd.intValue();
		}

		public static boolean is(int i){
			if(Math.log(i)/ Math.log(2) ==(int) (Math.log(i)/ Math.log(2)))
				return true ;
			if(Math.log(i)/ Math.log(3) ==(int) (Math.log(i)/ Math.log(3)) )
				return true ;
			if(Math.log(i)/ Math.log(6) ==(int) (Math.log(i)/ Math.log(6)) )
				return true ;

			return false;

		}
		public static boolean contains(int b[] , int x)
		{
			for (int i = 0; i < b.length; i++)
			{
				if(b[i]==x)
					return true ;
			}
			return false ;
		}
		public static int binary(long []arr , long target , int low , long shift) {
			int high = arr.length;
			while (low != high) {
				int mid = (low + high) / 2;
				if (arr[mid]-shift <= target) {
					low = mid + 1;
				}
				else {
					high = mid;
				}
			}
			return low ; // return high ;
		}
		public static boolean isLetter(char x){
			if(x+0 <=122 && x+0 >=97 )
				return true ;
			else if (x+0 <=90 && x+0 >=65 )
				return true ;
			else return false;
		}
		public static long getPrimes(long x ){
			if(x==2 || x==3 || x==1)
				return 2 ;
			if(isPrime(x))
				return 5 ;
			for (int i = 2; i*i<=x; i++)
			{
				if(x%i==0 && isPrime(i))
					return getPrimes(x/i) ;
			}
			return -1;
		}
		public static String solve(String x){

			int n = x.length() ;
			String y = "" ;
			for (int i = 0; i < n-2; i+=2)
			{
				if(ifPalindrome(x.substring(i, i+2)))
					y+= x.substring(i, i+2) ;
				else
					break ;
			}
			return y+ solve1(x.substring(y.length(),x.length())) ;

		}
		public static String solve1(String x){
			String y = x.substring(0 , x.length()/2) ;
			return "" ;

		}
		public static String reverse(String x){
			String y ="" ;
			for (int i = 0; i < x.length(); i++)
			{
				y  = x.charAt(i) + y ;
			}
			return y ;
		}

		public static boolean ifPalindrome(String x){
			int numbers[] = new int[10] ;
			for (int i = 0; i < x.length(); i++)
			{
				int z = Integer.parseInt(x.charAt(i)+"") ;
				numbers[z] ++ ;
			}
			for (int i = 0; i < numbers.length; i++)
			{
				if(numbers[i]%2!=0)
					return false;
			}
			return true ;
		}

		public static int get(int n){
			return n*(n+1)/2 ;
		}
		//		public static long getSmallestDivisor( long y){
		//			if(isPrime(y))
		//				return -1;
		//
		//			for (long i = 2; i*i <= y; i++)
		//			{
		//				if(y%i ==0)
		//				{
		//					return i;
		//				}
		//			}
		//			return -1;
		//		}
		//		public static void lis(pair []a , int n){
		//			int lis[] = new int[n] ;
		//			Arrays.fill(lis,1) ;
		//
		//			for(int i=1;i<n;i++)
		//				for(int j=0 ; j<i; j++)
		//					if (a[i].y>a[j].y &&  lis[i] < lis[j]+1)
		//						lis[i] = lis[j] + 1;
		//
		//			int max = lis[0];
		//
		//			for(int i=1; i<n ; i++)
		//				if (max < lis[i])
		//					max = lis[i] ;
		//			System.out.println(max);
		//
		//			ArrayList<Integer> s = new ArrayList<Integer>() ;
		//			for (int i = n-1; i >=0; i--)
		//			{
		//				if(lis[i]==max)
		//				{
		//					s.add(a[i].z);
		//					max --;
		//				}
		//			}
		//
		//			for (int i = s.size()-1 ; i>=0 ;  i--)
		//			{
		//				System.out.print(s.get(i)+" ");
		//			}
		//
		//			return  ;
		//		}
		public static int calcDepth(Vertix node){
			if(node.depth>0) return node.depth;
			// meaning it has been updated before;
			if(node.parent != null)
				return 1+ calcDepth(node.parent);
			else
				return -1;
		}

		public static boolean isPrime (long num){
			if (num < 2) return false;
			if (num == 2) return true;
			if (num % 2 == 0) return false;
			for (int i = 3; i * i <= num; i += 2)
				if (num % i == 0) return false;
			return true;
		}

		public static int[] getDiv(int n)
		{
			int result[] = new int[7] ;
			ArrayList<Integer>  f = new ArrayList<Integer>() ;

			while (n%2==0)
			{
				if(!f.contains(2))f.add(2) ;
				n /= 2;
			}

			// n must be odd at this point.  So we can
			// skip one element (Note i = i +2)
			for (int i = 3; i <= Math.sqrt(n); i+= 2)
			{
				// While i divides n, print i and divide n
				while (n%i == 0)
				{
					if(!f.contains(i))f.add(i);
					n /= i;
				}
			}

			// This condition is to handle the case whien
			// n is a prime number greater than 2
			if (n > 2)
				if(!f.contains(n))f.add(n);

			for (int i = 0, j=0; i < f.size(); i++)
			{
				result[j++]=f.get(i);
			}
			return result ;

		}

		//		public static boolean dfs(Vertix v , int target){
		//			try{
		//				visited[v.i]= true ;
		//			} catch (NullPointerException e)
		//			{
		//				System.out.println(v.i);
		//			}
		//			if(v.i == target)
		//
		//				return true ;
		//			for (int i =0 ; i< v.neighbours.size() ; i++)
		//			{
		//
		//				Vertix child = v.neighbours.get(i) ;
		//				if(child.i == target){
		//					found = true  ;
		//				}
		//				if(visited[child.i]==false){
		//					found |= dfs(child, target) ;
		//				}
		//			}
		//			return found;
		//		}

	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
	public static class Vertix{
		long i ;
		int depth ;
		ArrayList<Vertix> neighbours ;
		Vertix parent ;
		Vertix child ;

		public Vertix(long i){
			this.i = i ;
			this.neighbours = new ArrayList<Vertix> () ;
			this.parent = null ;
			depth =-1;
			this.child = null ;
		}
	}

	public static class pair implements Comparable<pair>{
		int i ;
		int r ;
		int qless  ; /// is his quarrel has skill less than him

		public pair(int x, int y ,int z){
			this.i=x ;
			this.r=y ;
			this .qless =z ;

		}

		@Override
		public int compareTo(pair p) {
			if(this.r > p.r)
				return 1 ;
			else if(this.r == p.r) return 0 ;
			else return -1 ;

		}

	}

	public static class pair2 implements Comparable<pair2>{
		int i ;
		boolean last ;

		public pair2(int i , boolean result){
			this.i =i ;
			this.last = result ;
		}

		@Override
		public int compareTo(pair2 p) {
			if(this.i > p.i)
				return 1 ;
			else if (this.i == p.i) return 0 ;
			else
				return -1 ;
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException, InterruptedException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskC {
		static boolean visited[]  ;
		static boolean found = false;

		static int steps = 0 ;
		static int n ;
		static boolean memo [][] ;
		static int dp[][] ;
		static char matrix[][] ;
		static ArrayList<Integer> p  ;
		public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException, InterruptedException {

			int n = in.nextInt() ;
			int k =in.nextInt() ;

			int a[] =  new int[n] ;
			int c=0 ;
			for (int i = 0; i < a.length; i++)
			{
				a[i]=in.nextInt();
				if(a[i]<0)
					c++;
			}

			if(c==0)
			{
				System.out.println(0);
				return ;
			}
			if(k==0)
			{
				System.out.println(-1);
				return ;
			}

			if(k<c)
				System.out.println(-1);
			else if (k==c)
			{
				int changes=0 ;
				boolean summer= true ;
				for (int i = 0; i < a.length; i++)
					if(a[i]<0 && summer)
					{
						changes ++;
						summer = false ;
					}else if (a[i]>=0 && !summer)
					{
						changes ++ ;
						summer = true ;
					}else continue ;

				System.out.println(changes);
			}
			else
			{
				int x=k-c ;
				int begin =0 ;
				for (int i = 0; i < a.length; i++)
					if(a[i]<0){begin = i ; break ;}
				ArrayList<pair2> pos = new ArrayList<pair2>() ;

				for (int i = begin; i < a.length; i++)
				{
					if(a[i]>=0)
					{
						int d=1 ;
						int end = i+1 ;
						for (int j = i+1; j < a.length; j++)
						{
							if(a[j]>=0){d++; end = j ;} else {end =j ; break ;}
						}
						pair2 now = new pair2(d,false) ;
						if(end ==n || end==n-1) now.last=true ;
						pos.add(now);
						i=end ;
					}
				}

				System.err.println("pos");
				for (int i = 0; i < pos.size(); i++)
				{
					System.err.println(pos.get(i).i+" "+pos.get(i).last);
				}
				Collections.sort(pos);
				System.err.println("pos");

				int min1 =0 ;
				int min2 =0 ;

				int xx =x ;
				System.err.println(x+"x");
				for (int i = 0; i < pos.size(); i++)
				{
					if(x>=pos.get(i).i)
					{
						min1 +=2 ;
						System.out.println(min1);
						x-=pos.get(i).i ;
						if(pos.get(i).last==true) min1--;
					}
				}
				for (int i = 0; i < pos.size(); i++)
				{
					if(xx>=pos.get(i).i && pos.get(i).last==false)
					{
						min2+=2 ;
						xx-=pos.get(i).i ;
					}
				}
				System.err.println("com mins");
				System.err.println(min2);
				System.err.println(min1);
				min1 = Math.max(min1, min2) ;

				int changes=0 ;
				boolean summer= true ;
				for (int i = 0; i < a.length; i++)
					if(a[i]<0 && summer)
					{
						changes ++;
						summer = false ;
					}else if (a[i]>=0 && !summer)
					{
						changes ++ ;
						summer = true ;
					}else continue ;

				System.err.println(changes);
				changes -= min1 ;
				System.out.println(changes);

			}

			//				int rem= k  ;
			//				int need[] =  new int[n] ;
			//
			//				if(a[n-1]<0) need[n-1]=1 ;
			//				else need[n-1]=0 ;
			//
			//				for (int i = n-2; i >=0; i--)
			//				{
			//					if(a[i]<0)need[i]=need[i+1]+1 ;
			//					else need[i]=need[i+1] ;
			//
			//					//System.err.println(a[i]+"AA"+need[i]);
			//				}
			//
			//				for (int i = 0; i < need.length; i++)
			//				{
			//					System.err.print(need[i]+" ");
			//				}
			//				boolean summer= true ;
			//				int changes =0 ;
			//
			//				if(a[0]<0){summer = false ; rem -- ; changes++ ;}
			//
			//				for (int i = 1; i < n; i++)
			//				{
			//					if(a[i]<0 && summer)
			//					{
			//						changes ++ ;
			//						System.err.println("her"+i);
			//						summer = false  ;
			//						rem -- ;
			//					}else if(a[i]<0 && !summer){ rem -- ;}
			//					else if (a[i]>=0 && summer){continue ; }
			//					else {
			//						if(rem > need[i])
			//						{
			//							rem-- ;
			//						}else {summer = true ; changes ++ ; System.err.println("h"+i); }
			//					}
			//				}
			//
			//				System.out.println(changes);

		}

		public static int cnt1(int mat[][])  //how many swaps to be a 1 matrix
		{
			int m = mat.length ;
			int c=0 ;
			for (int i = 0; i < mat.length; i++)
			{
				for (int j = 0; j < mat.length; j++)
				{
					int x =  (i*m) +j ;
					if(x%2==0 && mat[i][j]==0)
						c++;
					if(x%2!=0 && mat[i][j]==1)
						c++;

				}
			}
			return c;
		}
		public static int cnt0(int mat[][])
		{
			int m = mat.length ;
			int c=0 ;
			for (int i = 0; i < mat.length; i++)
			{
				for (int j = 0; j < mat.length; j++)
				{
					int x =  (i*m) +j ;
					if(x%2!=0 && mat[i][j]==0)
						c++;
					if(x%2==0 && mat[i][j]==1)
						c++;

				}
			}
			return c;
		}

		public static boolean canFit2(int x1, int y1 , int x2 , int y2 , int x3 , int y3){
			if(x1==x2)
				if(x1==x3)
					return true ;
				else
					return false ;
			else
				if(x1==x3)
					return false ;
				else
				{
					long a = 1l*(y2-y1)*(x3-x2) ;
					long b = 1l*(y3-y2)*(x2-x1) ;

					if(a==b)
						return true;
					else
						return false ;

				}

		}
		public static void shuffle(int c[]){
			if(c.length==1)
				return ;
			for (int i = 0; i < c.length; i++)
			{
				Random rand = new Random();

				int  n = rand.nextInt(c.length-1) + 0;

				int temp = c[i] ;
				c[i] = c[n] ;
				c[n] = temp ;
			}
		}
		public static int binary(long[]arr, int l, int r, long x)   /// begin by 0 and n-1
		{
			if (r>=l)
			{
				int mid = l + (r - l)/2;
				if (arr[mid]== x)
					return mid;
				if (arr[mid]> x)
					return binary(arr, l, mid-1, x);
				return binary(arr, mid+1, r, x);
			}
			return -1;
		}

		/// searching for the index of first elment greater than x
		public static int binary1(long[]arr , long x) {
			int low = 0, high = arr.length; // numElems is the size of the array i.e arr.size()
			while (low != high) {
				int mid = (low + high) / 2; // Or a fancy way to avoid int overflow
				if (arr[mid] <= x) {
					/* This index, and everything below it, must not be the first element
					 * greater than what we're looking for because this element is no greater
					 * than the element.
					 */
					low = mid + 1;
				}
				else {
					/* This element is at least as large as the element, so anything after it can't
					 * be the first element that's at least as large.
					 */
					high = mid;
				}
			}
			return low ; // return high ;
		}

		private static boolean triangle(int a, int b , int c){
			if(a+b>c && a+c>b && b+c>a)
				return true ;
			else
				return false ;
		}
		private static boolean segment(int a, int b , int c){
			if(a+b==c || a+c==b && b+c==a)
				return true ;
			else
				return false ;
		}
		private static int gcdThing(long a, long b) {
			BigInteger b1 = BigInteger.valueOf(a);
			BigInteger b2 = BigInteger.valueOf(b);
			BigInteger gcd = b1.gcd(b2);
			return gcd.intValue();
		}

		public static boolean is(int i){
			if(Math.log(i)/ Math.log(2) ==(int) (Math.log(i)/ Math.log(2)))
				return true ;
			if(Math.log(i)/ Math.log(3) ==(int) (Math.log(i)/ Math.log(3)) )
				return true ;
			if(Math.log(i)/ Math.log(6) ==(int) (Math.log(i)/ Math.log(6)) )
				return true ;

			return false;

		}
		public static boolean contains(int b[] , int x)
		{
			for (int i = 0; i < b.length; i++)
			{
				if(b[i]==x)
					return true ;
			}
			return false ;
		}
		public static int binary(long []arr , long target , int low , long shift) {
			int high = arr.length;
			while (low != high) {
				int mid = (low + high) / 2;
				if (arr[mid]-shift <= target) {
					low = mid + 1;
				}
				else {
					high = mid;
				}
			}
			return low ; // return high ;
		}
		public static boolean isLetter(char x){
			if(x+0 <=122 && x+0 >=97 )
				return true ;
			else if (x+0 <=90 && x+0 >=65 )
				return true ;
			else return false;
		}
		public static long getPrimes(long x ){
			if(x==2 || x==3 || x==1)
				return 2 ;
			if(isPrime(x))
				return 5 ;
			for (int i = 2; i*i<=x; i++)
			{
				if(x%i==0 && isPrime(i))
					return getPrimes(x/i) ;
			}
			return -1;
		}
		public static String solve(String x){

			int n = x.length() ;
			String y = "" ;
			for (int i = 0; i < n-2; i+=2)
			{
				if(ifPalindrome(x.substring(i, i+2)))
					y+= x.substring(i, i+2) ;
				else
					break ;
			}
			return y+ solve1(x.substring(y.length(),x.length())) ;

		}
		public static String solve1(String x){
			String y = x.substring(0 , x.length()/2) ;
			return "" ;

		}
		public static String reverse(String x){
			String y ="" ;
			for (int i = 0; i < x.length(); i++)
			{
				y  = x.charAt(i) + y ;
			}
			return y ;
		}

		public static boolean ifPalindrome(String x){
			int numbers[] = new int[10] ;
			for (int i = 0; i < x.length(); i++)
			{
				int z = Integer.parseInt(x.charAt(i)+"") ;
				numbers[z] ++ ;
			}
			for (int i = 0; i < numbers.length; i++)
			{
				if(numbers[i]%2!=0)
					return false;
			}
			return true ;
		}

		public static int get(int n){
			return n*(n+1)/2 ;
		}
		//		public static long getSmallestDivisor( long y){
		//			if(isPrime(y))
		//				return -1;
		//
		//			for (long i = 2; i*i <= y; i++)
		//			{
		//				if(y%i ==0)
		//				{
		//					return i;
		//				}
		//			}
		//			return -1;
		//		}
		//		public static void lis(pair []a , int n){
		//			int lis[] = new int[n] ;
		//			Arrays.fill(lis,1) ;
		//
		//			for(int i=1;i<n;i++)
		//				for(int j=0 ; j<i; j++)
		//					if (a[i].y>a[j].y &&  lis[i] < lis[j]+1)
		//						lis[i] = lis[j] + 1;
		//
		//			int max = lis[0];
		//
		//			for(int i=1; i<n ; i++)
		//				if (max < lis[i])
		//					max = lis[i] ;
		//			System.out.println(max);
		//
		//			ArrayList<Integer> s = new ArrayList<Integer>() ;
		//			for (int i = n-1; i >=0; i--)
		//			{
		//				if(lis[i]==max)
		//				{
		//					s.add(a[i].z);
		//					max --;
		//				}
		//			}
		//
		//			for (int i = s.size()-1 ; i>=0 ;  i--)
		//			{
		//				System.out.print(s.get(i)+" ");
		//			}
		//
		//			return  ;
		//		}
		public static int calcDepth(Vertix node){
			if(node.depth>0) return node.depth;
			// meaning it has been updated before;
			if(node.parent != null)
				return 1+ calcDepth(node.parent);
			else
				return -1;
		}

		public static boolean isPrime (long num){
			if (num < 2) return false;
			if (num == 2) return true;
			if (num % 2 == 0) return false;
			for (int i = 3; i * i <= num; i += 2)
				if (num % i == 0) return false;
			return true;
		}

		public static int[] getDiv(int n)
		{
			int result[] = new int[7] ;
			ArrayList<Integer>  f = new ArrayList<Integer>() ;

			while (n%2==0)
			{
				if(!f.contains(2))f.add(2) ;
				n /= 2;
			}

			// n must be odd at this point.  So we can
			// skip one element (Note i = i +2)
			for (int i = 3; i <= Math.sqrt(n); i+= 2)
			{
				// While i divides n, print i and divide n
				while (n%i == 0)
				{
					if(!f.contains(i))f.add(i);
					n /= i;
				}
			}

			// This condition is to handle the case whien
			// n is a prime number greater than 2
			if (n > 2)
				if(!f.contains(n))f.add(n);

			for (int i = 0, j=0; i < f.size(); i++)
			{
				result[j++]=f.get(i);
			}
			return result ;

		}

		//		public static boolean dfs(Vertix v , int target){
		//			try{
		//				visited[v.i]= true ;
		//			} catch (NullPointerException e)
		//			{
		//				System.out.println(v.i);
		//			}
		//			if(v.i == target)
		//
		//				return true ;
		//			for (int i =0 ; i< v.neighbours.size() ; i++)
		//			{
		//
		//				Vertix child = v.neighbours.get(i) ;
		//				if(child.i == target){
		//					found = true  ;
		//				}
		//				if(visited[child.i]==false){
		//					found |= dfs(child, target) ;
		//				}
		//			}
		//			return found;
		//		}

	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
	public static class Vertix{
		long i ;
		int depth ;
		ArrayList<Vertix> neighbours ;
		Vertix parent ;
		Vertix child ;

		public Vertix(long i){
			this.i = i ;
			this.neighbours = new ArrayList<Vertix> () ;
			this.parent = null ;
			depth =-1;
			this.child = null ;
		}
	}

	public static class pair implements Comparable<pair>{
		int i ;
		int r ;
		int qless  ; /// is his quarrel has skill less than him

		public pair(int x, int y ,int z){
			this.i=x ;
			this.r=y ;
			this .qless =z ;

		}

		@Override
		public int compareTo(pair p) {
			if(this.r > p.r)
				return 1 ;
			else if(this.r == p.r) return 0 ;
			else return -1 ;

		}

	}

	public static class pair2 implements Comparable<pair2>{
		int i ;
		boolean last ;

		public pair2(int i , boolean result){
			this.i =i ;
			this.last = result ;
		}

		@Override
		public int compareTo(pair2 p) {
			if(this.i > p.i)
				return 1 ;
			else if (this.i == p.i) return 0 ;
			else
				return -1 ;
		}

	}

}