import java.util.Scanner;
 
public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	long N =sc.nextLong();
	long A =sc.nextLong();
	long B =sc.nextLong();
	long ans=0;
		ans+=((long)N/(A+B))*A;
		if(A-N%(A+B)>0) {
			ans+=N%(A+B);
		}else if(A-N%(A+B)<=0) {
			ans+=A;
		}
	p(ans);
	
	
	}
} import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	long N =sc.nextLong();
	long A =sc.nextLong();
	long B =sc.nextLong();
	long ans=0;
		ans+=((long)N/(A+B))*A;
		if(A-N%(A+B)>0) {
			ans+=N%(A+B);
		}else if(A-N%(A+B)<=0) {
			ans+=A;
		}
	p(ans);
	
	
	}
} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}; eikomoji {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"} "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" static void p(String ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans String ans ans static void p(int ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans int ans ans static void p(long ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans long ans ans public static void main(String[] args) {
	long N =sc.nextLong();
	long A =sc.nextLong();
	long B =sc.nextLong();
	long ans=0;
		ans+=((long)N/(A+B))*A;
		if(A-N%(A+B)>0) {
			ans+=N%(A+B);
		}else if(A-N%(A+B)<=0) {
			ans+=A;
		}
	p(ans);
	
	
	} main {
	long N =sc.nextLong();
	long A =sc.nextLong();
	long B =sc.nextLong();
	long ans=0;
		ans+=((long)N/(A+B))*A;
		if(A-N%(A+B)>0) {
			ans+=N%(A+B);
		}else if(A-N%(A+B)<=0) {
			ans+=A;
		}
	p(ans);
	
	
	} long N =sc.nextLong(); N sc.nextLong() sc.nextLong sc long A =sc.nextLong(); A sc.nextLong() sc.nextLong sc long B =sc.nextLong(); B sc.nextLong() sc.nextLong sc long ans=0; ans 0 ans+=((long)N/(A+B))*A ans ((long)N/(A+B))*A ((long)N/(A+B)) (long)N (A+B) A B A if(A-N%(A+B)>0) {
			ans+=N%(A+B);
		}else if(A-N%(A+B)<=0) {
			ans+=A;
		} A-N%(A+B)>0 A-N%(A+B) A N%(A+B) N (A+B) A B 0 {
			ans+=N%(A+B);
		} ans+=N%(A+B) ans N%(A+B) N (A+B) A B if(A-N%(A+B)<=0) {
			ans+=A;
		} A-N%(A+B)<=0 A-N%(A+B) A N%(A+B) N (A+B) A B 0 {
			ans+=A;
		} ans+=A ans A p(ans) p ans String[] args args public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	long N =sc.nextLong();
	long A =sc.nextLong();
	long B =sc.nextLong();
	long ans=0;
		ans+=((long)N/(A+B))*A;
		if(A-N%(A+B)>0) {
			ans+=N%(A+B);
		}else if(A-N%(A+B)<=0) {
			ans+=A;
		}
	p(ans);
	
	
	}
} public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	long N =sc.nextLong();
	long A =sc.nextLong();
	long B =sc.nextLong();
	long ans=0;
		ans+=((long)N/(A+B))*A;
		if(A-N%(A+B)>0) {
			ans+=N%(A+B);
		}else if(A-N%(A+B)<=0) {
			ans+=A;
		}
	p(ans);
	
	
	}
} Main
import java.util.Scanner;
 
public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	long N =sc.nextLong();
	long A =sc.nextLong();
	long B =sc.nextLong();
	long ans=0;
		ans+=((long)N/(A+B))*A;
		if(A-N%(A+B)>0) {
			ans+=N%(A+B);
		}else if(A-N%(A+B)<=0) {
			ans+=A;
		}
	p(ans);
	
	
	}
}