import java.util.*; public class Test12 { public static void main(String[] args){ Scanner sc=new Scanner(System.in); String[] line; String regex=" ",result=""; line=sc.nextLine().split(regex); int vege=Integer.parseInt(line[0]); int meat=Integer.parseInt(line[1]); int require=Integer.parseInt(line[2]); int capa=Integer.parseInt(line[3]); int eaten=0; while(true){ meat-=require; vege-=1; capa-=require+1; if(meat<0||vege<0||capa<0) break; eaten++; } result+=eaten; System.out.println(result); sc.close(); } }