import java.util.*;
import java.util.Map.Entry;
 
class Main {
	 static int mod =  (int) (Math.pow(10,9)+7);
	 static int[] ans;
//	 static int mod = 998244353;
   public static void main(String[] args) {
	          
	   Scanner sc = new Scanner(System.in);
       long  N = sc.nextLong();
       long  A = sc.nextLong();
       long  B = sc.nextLong();
       long ans1=0;
       long ans2=0;
       
       ans1=A*(N/(A+B));
       ans2=B*(N/(A+B));
       if(N%(A+B)<A) {
    	   ans1=ans1+N%(A+B);
       } else {
    	   ans1=ans1+A;
    	   ans2=ans2+N%(A+B)-A;
       }
       
       
       System.out.println(ans1); 
       return;
   }

} import java.util.*; util.* java import java.util.Map.Entry; Entry java.util.Map class Main {
	 static int mod =  (int) (Math.pow(10,9)+7);
	 static int[] ans;
//	 static int mod = 998244353;
   public static void main(String[] args) {
	          
	   Scanner sc = new Scanner(System.in);
       long  N = sc.nextLong();
       long  A = sc.nextLong();
       long  B = sc.nextLong();
       long ans1=0;
       long ans2=0;
       
       ans1=A*(N/(A+B));
       ans2=B*(N/(A+B));
       if(N%(A+B)<A) {
    	   ans1=ans1+N%(A+B);
       } else {
    	   ans1=ans1+A;
    	   ans2=ans2+N%(A+B)-A;
       }
       
       
       System.out.println(ans1); 
       return;
   }

} Main static int mod =  (int) (Math.pow(10,9)+7); mod (int) (Math.pow(10,9)+7) Math.pow(10,9) Math.pow Math 10 9 7 static int[] ans; ans //	 static int mod = 998244353;
   public static void main(String[] args) {
	          
	   Scanner sc = new Scanner(System.in);
       long  N = sc.nextLong();
       long  A = sc.nextLong();
       long  B = sc.nextLong();
       long ans1=0;
       long ans2=0;
       
       ans1=A*(N/(A+B));
       ans2=B*(N/(A+B));
       if(N%(A+B)<A) {
    	   ans1=ans1+N%(A+B);
       } else {
    	   ans1=ans1+A;
    	   ans2=ans2+N%(A+B)-A;
       }
       
       
       System.out.println(ans1); 
       return;
   } main {
	          
	   Scanner sc = new Scanner(System.in);
       long  N = sc.nextLong();
       long  A = sc.nextLong();
       long  B = sc.nextLong();
       long ans1=0;
       long ans2=0;
       
       ans1=A*(N/(A+B));
       ans2=B*(N/(A+B));
       if(N%(A+B)<A) {
    	   ans1=ans1+N%(A+B);
       } else {
    	   ans1=ans1+A;
    	   ans2=ans2+N%(A+B)-A;
       }
       
       
       System.out.println(ans1); 
       return;
   } 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 ans1=0; ans1 0 long ans2=0; ans2 0 ans1=A*(N/(A+B)) ans1 A*(N/(A+B)) A (N/(A+B)) N (A+B) A B ans2=B*(N/(A+B)) ans2 B*(N/(A+B)) B (N/(A+B)) N (A+B) A B if(N%(A+B)<A) {
    	   ans1=ans1+N%(A+B);
       } else {
    	   ans1=ans1+A;
    	   ans2=ans2+N%(A+B)-A;
       } N%(A+B)<A N%(A+B) N (A+B) A B A {
    	   ans1=ans1+N%(A+B);
       } ans1=ans1+N%(A+B) ans1 ans1+N%(A+B) ans1 N%(A+B) N (A+B) A B {
    	   ans1=ans1+A;
    	   ans2=ans2+N%(A+B)-A;
       } ans1=ans1+A ans1 ans1+A ans1 A ans2=ans2+N%(A+B)-A ans2 ans2+N%(A+B)-A ans2+N%(A+B) ans2 N%(A+B) N (A+B) A B A System.out.println(ans1) System.out.println System.out System System.out ans1 return; String[] args args
import java.util.*;
import java.util.Map.Entry;
 
class Main {
	 static int mod =  (int) (Math.pow(10,9)+7);
	 static int[] ans;
//	 static int mod = 998244353;
   public static void main(String[] args) {
	          
	   Scanner sc = new Scanner(System.in);
       long  N = sc.nextLong();
       long  A = sc.nextLong();
       long  B = sc.nextLong();
       long ans1=0;
       long ans2=0;
       
       ans1=A*(N/(A+B));
       ans2=B*(N/(A+B));
       if(N%(A+B)<A) {
    	   ans1=ans1+N%(A+B);
       } else {
    	   ans1=ans1+A;
    	   ans2=ans2+N%(A+B)-A;
       }
       
       
       System.out.println(ans1); 
       return;
   }

}
