import java.util.*;
import java.io.*; 

public class Main {
	
	public static void main(String... string) {
		Scanner sc = new Scanner(System.in); 
		long n = sc.nextLong();
		long blue = sc.nextLong();
		long red = sc.nextLong();
		long ans = n/(red+blue) * blue; 
		long y = n%(red+blue); 
	    System.out.println(ans + Math.min(blue, y)); 
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
	
	public static void main(String... string) {
		Scanner sc = new Scanner(System.in); 
		long n = sc.nextLong();
		long blue = sc.nextLong();
		long red = sc.nextLong();
		long ans = n/(red+blue) * blue; 
		long y = n%(red+blue); 
	    System.out.println(ans + Math.min(blue, y)); 
	}
} Main public static void main(String... string) {
		Scanner sc = new Scanner(System.in); 
		long n = sc.nextLong();
		long blue = sc.nextLong();
		long red = sc.nextLong();
		long ans = n/(red+blue) * blue; 
		long y = n%(red+blue); 
	    System.out.println(ans + Math.min(blue, y)); 
	} main {
		Scanner sc = new Scanner(System.in); 
		long n = sc.nextLong();
		long blue = sc.nextLong();
		long red = sc.nextLong();
		long ans = n/(red+blue) * blue; 
		long y = n%(red+blue); 
	    System.out.println(ans + Math.min(blue, y)); 
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long blue = sc.nextLong(); blue sc.nextLong() sc.nextLong sc long red = sc.nextLong(); red sc.nextLong() sc.nextLong sc long ans = n/(red+blue) * blue; ans n/(red+blue) * blue n/(red+blue) n (red+blue) red blue blue long y = n%(red+blue); y n%(red+blue) n (red+blue) red blue System.out.println(ans + Math.min(blue, y)) System.out.println System.out System System.out ans + Math.min(blue, y) ans Math.min(blue, y) Math.min Math blue y String... string string public class Main {
	
	public static void main(String... string) {
		Scanner sc = new Scanner(System.in); 
		long n = sc.nextLong();
		long blue = sc.nextLong();
		long red = sc.nextLong();
		long ans = n/(red+blue) * blue; 
		long y = n%(red+blue); 
	    System.out.println(ans + Math.min(blue, y)); 
	}
} public class Main {
	
	public static void main(String... string) {
		Scanner sc = new Scanner(System.in); 
		long n = sc.nextLong();
		long blue = sc.nextLong();
		long red = sc.nextLong();
		long ans = n/(red+blue) * blue; 
		long y = n%(red+blue); 
	    System.out.println(ans + Math.min(blue, y)); 
	}
} Main
import java.util.*;
import java.io.*; 

public class Main {
	
	public static void main(String... string) {
		Scanner sc = new Scanner(System.in); 
		long n = sc.nextLong();
		long blue = sc.nextLong();
		long red = sc.nextLong();
		long ans = n/(red+blue) * blue; 
		long y = n%(red+blue); 
	    System.out.println(ans + Math.min(blue, y)); 
	}
}