import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { String s = sc.next(); int c_num = 0; int w_num = 0; for (int i=0; i= w_num) { System.out.println(w_num); } else if (c_num-1 < w_num) { System.out.println(c_num-1); } } }