// Arup Guha
// 1/28/2026
// Solution to Question #1 for COP 3330 Quiz #1

import java.util.*;

public class quiz1q1 {

	public static void main(String[] args) {
	
		int res = 0;
		
		// Get all the user input.
		Scanner stdin = new Scanner(System.in);
		System.out.println("How many apples per basket?");
		int applesPerBasket = stdin.nextInt();
		System.out.println("How many oranges per basket?");
		int orangesPerBasket = stdin.nextInt();
		System.out.println("How many apples do you have total?");
		int applesTotal = stdin.nextInt();
		System.out.println("How many oranges do you have total?");
		int orangesTotal = stdin.nextInt();		
		
		// Integer division for each fruit, then min allows us to look at the limiting factor.
		int appleLimit = applesTotal/applesPerBasket;
		int orangeLimit = orangesTotal/orangesPerBasket;
		res = Math.min( appleLimit, orangeLimit );

		// Ta da!
		System.out.println("You can make a total of "+res+" complete baskets.");
	}
}