import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int L = sc.nextInt(); int bn = sc.nextInt(); int[] bw = new int[bn]; int sum=0; int answer=0; for(int i=0;i=sum){ if(i==bn){ answer = bn; } }else{ answer = i-1; break; } } System.out.println(answer); } }