import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int [] c = new int [1000001]; for(int i=0; i0){ int tmp=0; for(int j=W; j<1000001; j++){ tmp+=c[j]; } if(tmp0)c[W]--; } } int ans=0; for(int j=0; j<1000001; j++){ ans+=c[j]; } System.out.println(ans); } }