/* 分からず */ package no200; import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = sc.nextInt(); int[] b = new int[a]; for(int i=0;i handA = new ArrayList<>(); ArrayList handB = new ArrayList<>(); int ans = 0; LOOP: for(int i=0;i=0;j--) { for(int k=0;k handB.get(j)) { handA.remove(k); handB.remove(j); ans++; continue LOOP; } } } handA.remove(0); handB.remove(handB.size()-1); // System.out.println(handA + "," + handB); } System.out.println(ans); } }