import java.util.*;
import java.io.*;
public class Main{
  
    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 div=n/(a+b);
            long rem=n%(a+b);
            
            long sum=div*a;
            sum+=Math.min(rem,a);
            System.out.println(sum);


    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
  
    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 div=n/(a+b);
            long rem=n%(a+b);
            
            long sum=div*a;
            sum+=Math.min(rem,a);
            System.out.println(sum);


    }
} Main 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 div=n/(a+b);
            long rem=n%(a+b);
            
            long sum=div*a;
            sum+=Math.min(rem,a);
            System.out.println(sum);


    } main {
        Scanner sc=new Scanner(System.in);
        long n=sc.nextLong();
        long a=sc.nextLong();
        long b=sc.nextLong();
    
            long div=n/(a+b);
            long rem=n%(a+b);
            
            long sum=div*a;
            sum+=Math.min(rem,a);
            System.out.println(sum);


    } 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 div=n/(a+b); div n/(a+b) n (a+b) a b long rem=n%(a+b); rem n%(a+b) n (a+b) a b long sum=div*a; sum div*a div a sum+=Math.min(rem,a) sum Math.min(rem,a) Math.min Math rem a System.out.println(sum) System.out.println System.out System System.out sum String [] args args public class Main{
  
    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 div=n/(a+b);
            long rem=n%(a+b);
            
            long sum=div*a;
            sum+=Math.min(rem,a);
            System.out.println(sum);


    }
} public class Main{
  
    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 div=n/(a+b);
            long rem=n%(a+b);
            
            long sum=div*a;
            sum+=Math.min(rem,a);
            System.out.println(sum);


    }
} Main
import java.util.*;
import java.io.*;
public class Main{
  
    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 div=n/(a+b);
            long rem=n%(a+b);
            
            long sum=div*a;
            sum+=Math.min(rem,a);
            System.out.println(sum);


    }
}