import java.util.concurrent.Semaphore;

public class Main {
    public static void main(String[] args) throws InterruptedException{
        Semaphore s = new Semaphore(-2);
        System.out.println(s);
        s.release();
        System.out.println(s);
        s.release();
        System.out.println(s);
        s.release();
        System.out.println(s);
        s.acquire();
        System.out.println(s);
    }
}