import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);

        long N=stdIn.nextLong();
        long A=stdIn.nextLong();
        long B=stdIn.nextLong();

        long C=N%(A+B);
        if(C>=A){
            C=A;
        }
        

        System.out.println(N/(A+B)*A+C);
        
        
    }

} import java.util.Scanner; Scanner java.util class Main {

    public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);

        long N=stdIn.nextLong();
        long A=stdIn.nextLong();
        long B=stdIn.nextLong();

        long C=N%(A+B);
        if(C>=A){
            C=A;
        }
        

        System.out.println(N/(A+B)*A+C);
        
        
    }

} Main public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);

        long N=stdIn.nextLong();
        long A=stdIn.nextLong();
        long B=stdIn.nextLong();

        long C=N%(A+B);
        if(C>=A){
            C=A;
        }
        

        System.out.println(N/(A+B)*A+C);
        
        
    } main {
        Scanner stdIn=new Scanner(System.in);

        long N=stdIn.nextLong();
        long A=stdIn.nextLong();
        long B=stdIn.nextLong();

        long C=N%(A+B);
        if(C>=A){
            C=A;
        }
        

        System.out.println(N/(A+B)*A+C);
        
        
    } Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) long N=stdIn.nextLong(); N stdIn.nextLong() stdIn.nextLong stdIn long A=stdIn.nextLong(); A stdIn.nextLong() stdIn.nextLong stdIn long B=stdIn.nextLong(); B stdIn.nextLong() stdIn.nextLong stdIn long C=N%(A+B); C N%(A+B) N (A+B) A B if(C>=A){
            C=A;
        } C>=A C A {
            C=A;
        } C=A C A System.out.println(N/(A+B)*A+C) System.out.println System.out System System.out N/(A+B)*A+C N/(A+B)*A N/(A+B) N (A+B) A B A C String[] args args
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);

        long N=stdIn.nextLong();
        long A=stdIn.nextLong();
        long B=stdIn.nextLong();

        long C=N%(A+B);
        if(C>=A){
            C=A;
        }
        

        System.out.println(N/(A+B)*A+C);
        
        
    }

}