import java.util.Scanner;
public class Main{
    

     public static void main(String []args){
         String x = new Scanner(System.in).nextLine();
		
		String array1[]=x.split("\\s+");
		long N =Long.parseLong(array1[0]);
		long A=Long.parseLong(array1[1]);
		long B=Long.parseLong(array1[2]);
		CoubtBalls(N,A,B);
		

     }
     public static void CoubtBalls(long N,long A,long B)
     {
         long result=0;
         long temp=0;
         if(N%(A+B) > A) 
         {
             temp=A;
         }
         else 
         {
            temp= N%(A+B);
         }
         result=((N/(A+B))*A)+temp;
         System.out.print(result);
     }
     
} import java.util.Scanner; Scanner java.util public class Main{
    

     public static void main(String []args){
         String x = new Scanner(System.in).nextLine();
		
		String array1[]=x.split("\\s+");
		long N =Long.parseLong(array1[0]);
		long A=Long.parseLong(array1[1]);
		long B=Long.parseLong(array1[2]);
		CoubtBalls(N,A,B);
		

     }
     public static void CoubtBalls(long N,long A,long B)
     {
         long result=0;
         long temp=0;
         if(N%(A+B) > A) 
         {
             temp=A;
         }
         else 
         {
            temp= N%(A+B);
         }
         result=((N/(A+B))*A)+temp;
         System.out.print(result);
     }
     
} Main public static void main(String []args){
         String x = new Scanner(System.in).nextLine();
		
		String array1[]=x.split("\\s+");
		long N =Long.parseLong(array1[0]);
		long A=Long.parseLong(array1[1]);
		long B=Long.parseLong(array1[2]);
		CoubtBalls(N,A,B);
		

     } main {
         String x = new Scanner(System.in).nextLine();
		
		String array1[]=x.split("\\s+");
		long N =Long.parseLong(array1[0]);
		long A=Long.parseLong(array1[1]);
		long B=Long.parseLong(array1[2]);
		CoubtBalls(N,A,B);
		

     } String x = new Scanner(System.in).nextLine(); x new Scanner(System.in).nextLine() new Scanner(System.in).nextLine new Scanner(System.in) String array1[]=x.split("\\s+"); array1 x.split("\\s+") x.split x "\\s+" long N =Long.parseLong(array1[0]); N Long.parseLong(array1[0]) Long.parseLong Long array1[0] array1 0 long A=Long.parseLong(array1[1]); A Long.parseLong(array1[1]) Long.parseLong Long array1[1] array1 1 long B=Long.parseLong(array1[2]); B Long.parseLong(array1[2]) Long.parseLong Long array1[2] array1 2 CoubtBalls(N,A,B) CoubtBalls N A B String []args args public static void CoubtBalls(long N,long A,long B)
     {
         long result=0;
         long temp=0;
         if(N%(A+B) > A) 
         {
             temp=A;
         }
         else 
         {
            temp= N%(A+B);
         }
         result=((N/(A+B))*A)+temp;
         System.out.print(result);
     } CoubtBalls {
         long result=0;
         long temp=0;
         if(N%(A+B) > A) 
         {
             temp=A;
         }
         else 
         {
            temp= N%(A+B);
         }
         result=((N/(A+B))*A)+temp;
         System.out.print(result);
     } long result=0; result 0 long temp=0; temp 0 if(N%(A+B) > A) 
         {
             temp=A;
         }
         else 
         {
            temp= N%(A+B);
         } N%(A+B) > A N%(A+B) N (A+B) A B A {
             temp=A;
         } temp=A temp A {
            temp= N%(A+B);
         } temp= N%(A+B) temp N%(A+B) N (A+B) A B result=((N/(A+B))*A)+temp result ((N/(A+B))*A)+temp ((N/(A+B))*A) (N/(A+B)) N (A+B) A B A temp System.out.print(result) System.out.print System.out System System.out result long N N long A A long B B public class Main{
    

     public static void main(String []args){
         String x = new Scanner(System.in).nextLine();
		
		String array1[]=x.split("\\s+");
		long N =Long.parseLong(array1[0]);
		long A=Long.parseLong(array1[1]);
		long B=Long.parseLong(array1[2]);
		CoubtBalls(N,A,B);
		

     }
     public static void CoubtBalls(long N,long A,long B)
     {
         long result=0;
         long temp=0;
         if(N%(A+B) > A) 
         {
             temp=A;
         }
         else 
         {
            temp= N%(A+B);
         }
         result=((N/(A+B))*A)+temp;
         System.out.print(result);
     }
     
} public class Main{
    

     public static void main(String []args){
         String x = new Scanner(System.in).nextLine();
		
		String array1[]=x.split("\\s+");
		long N =Long.parseLong(array1[0]);
		long A=Long.parseLong(array1[1]);
		long B=Long.parseLong(array1[2]);
		CoubtBalls(N,A,B);
		

     }
     public static void CoubtBalls(long N,long A,long B)
     {
         long result=0;
         long temp=0;
         if(N%(A+B) > A) 
         {
             temp=A;
         }
         else 
         {
            temp= N%(A+B);
         }
         result=((N/(A+B))*A)+temp;
         System.out.print(result);
     }
     
} Main
import java.util.Scanner;
public class Main{
    

     public static void main(String []args){
         String x = new Scanner(System.in).nextLine();
		
		String array1[]=x.split("\\s+");
		long N =Long.parseLong(array1[0]);
		long A=Long.parseLong(array1[1]);
		long B=Long.parseLong(array1[2]);
		CoubtBalls(N,A,B);
		

     }
     public static void CoubtBalls(long N,long A,long B)
     {
         long result=0;
         long temp=0;
         if(N%(A+B) > A) 
         {
             temp=A;
         }
         else 
         {
            temp= N%(A+B);
         }
         result=((N/(A+B))*A)+temp;
         System.out.print(result);
     }
     
}