import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		int count=0;
		long blueCount=0;
		long aAmari=0;
		
		Scanner sc=new Scanner(System.in);
		long N=sc.nextLong();
		long A=sc.nextLong();
		long B=sc.nextLong();
		//何回、A+Bの組み合わせが続くか
		long syou=N/(A+B);
		//A+Bのあまり
		long kaisu=N%(A+B);
		
			if(kaisu==0) {
				blueCount=A*syou;
			}else {
				if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				}
			}
		System.out.println(blueCount);
		
	}
 
} import java.util.Scanner; Scanner java.util public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		int count=0;
		long blueCount=0;
		long aAmari=0;
		
		Scanner sc=new Scanner(System.in);
		long N=sc.nextLong();
		long A=sc.nextLong();
		long B=sc.nextLong();
		//何回、A+Bの組み合わせが続くか
		long syou=N/(A+B);
		//A+Bのあまり
		long kaisu=N%(A+B);
		
			if(kaisu==0) {
				blueCount=A*syou;
			}else {
				if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				}
			}
		System.out.println(blueCount);
		
	}
 
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		int count=0;
		long blueCount=0;
		long aAmari=0;
		
		Scanner sc=new Scanner(System.in);
		long N=sc.nextLong();
		long A=sc.nextLong();
		long B=sc.nextLong();
		//何回、A+Bの組み合わせが続くか
		long syou=N/(A+B);
		//A+Bのあまり
		long kaisu=N%(A+B);
		
			if(kaisu==0) {
				blueCount=A*syou;
			}else {
				if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				}
			}
		System.out.println(blueCount);
		
	} main {
		// TODO 自動生成されたメソッド・スタブ
		
		int count=0;
		long blueCount=0;
		long aAmari=0;
		
		Scanner sc=new Scanner(System.in);
		long N=sc.nextLong();
		long A=sc.nextLong();
		long B=sc.nextLong();
		//何回、A+Bの組み合わせが続くか
		long syou=N/(A+B);
		//A+Bのあまり
		long kaisu=N%(A+B);
		
			if(kaisu==0) {
				blueCount=A*syou;
			}else {
				if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				}
			}
		System.out.println(blueCount);
		
	} int count=0; count 0 long blueCount=0; blueCount 0 long aAmari=0; aAmari 0 Scanner sc=new Scanner(System.in); sc new Scanner(System.in) 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 syou=N/(A+B); syou N/(A+B) N (A+B) A B long kaisu=N%(A+B); kaisu N%(A+B) N (A+B) A B if(kaisu==0) {
				blueCount=A*syou;
			}else {
				if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				}
			} kaisu==0 kaisu 0 {
				blueCount=A*syou;
			} blueCount=A*syou blueCount A*syou A syou {
				if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				}
			} if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				} kaisu<A kaisu A {
					blueCount=(A*syou)+kaisu;
				} blueCount=(A*syou)+kaisu blueCount (A*syou)+kaisu (A*syou) A syou kaisu {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				} aAmari=kaisu-A aAmari kaisu-A kaisu A if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				} aAmari<B aAmari B {
					blueCount=(A*syou)+A;
				} blueCount=(A*syou)+A blueCount (A*syou)+A (A*syou) A syou A {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				} aAmari=aAmari-B aAmari aAmari-B aAmari B blueCount=(A*syou)+A+aAmari blueCount (A*syou)+A+aAmari (A*syou)+A+aAmari (A*syou) A syou A aAmari System.out.println(blueCount) System.out.println System.out System System.out blueCount String[] args args public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		int count=0;
		long blueCount=0;
		long aAmari=0;
		
		Scanner sc=new Scanner(System.in);
		long N=sc.nextLong();
		long A=sc.nextLong();
		long B=sc.nextLong();
		//何回、A+Bの組み合わせが続くか
		long syou=N/(A+B);
		//A+Bのあまり
		long kaisu=N%(A+B);
		
			if(kaisu==0) {
				blueCount=A*syou;
			}else {
				if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				}
			}
		System.out.println(blueCount);
		
	}
 
} public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		int count=0;
		long blueCount=0;
		long aAmari=0;
		
		Scanner sc=new Scanner(System.in);
		long N=sc.nextLong();
		long A=sc.nextLong();
		long B=sc.nextLong();
		//何回、A+Bの組み合わせが続くか
		long syou=N/(A+B);
		//A+Bのあまり
		long kaisu=N%(A+B);
		
			if(kaisu==0) {
				blueCount=A*syou;
			}else {
				if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				}
			}
		System.out.println(blueCount);
		
	}
 
} Main
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		int count=0;
		long blueCount=0;
		long aAmari=0;
		
		Scanner sc=new Scanner(System.in);
		long N=sc.nextLong();
		long A=sc.nextLong();
		long B=sc.nextLong();
		//何回、A+Bの組み合わせが続くか
		long syou=N/(A+B);
		//A+Bのあまり
		long kaisu=N%(A+B);
		
			if(kaisu==0) {
				blueCount=A*syou;
			}else {
				if(kaisu<A) {
					blueCount=(A*syou)+kaisu;
				}else {
				aAmari=kaisu-A;
				if(aAmari<B) {
					blueCount=(A*syou)+A;
				}else {
					aAmari=aAmari-B;
					blueCount=(A*syou)+A+aAmari;
				}
				}
			}
		System.out.println(blueCount);
		
	}
 
}