import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scn = new Scanner(System.in);
        long N = scn.nextLong();
        long A = scn.nextLong();
        long B = scn.nextLong();
        
        if(A!=0){
            long tmp = (N/(A+B))*A;
            tmp += N%(A+B)<=A ? N%(A+B) : A;
            System.out.println(tmp);
        }
        else System.out.println(0);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scn = new Scanner(System.in);
        long N = scn.nextLong();
        long A = scn.nextLong();
        long B = scn.nextLong();
        
        if(A!=0){
            long tmp = (N/(A+B))*A;
            tmp += N%(A+B)<=A ? N%(A+B) : A;
            System.out.println(tmp);
        }
        else System.out.println(0);
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner scn = new Scanner(System.in);
        long N = scn.nextLong();
        long A = scn.nextLong();
        long B = scn.nextLong();
        
        if(A!=0){
            long tmp = (N/(A+B))*A;
            tmp += N%(A+B)<=A ? N%(A+B) : A;
            System.out.println(tmp);
        }
        else System.out.println(0);
    } main {
        
        Scanner scn = new Scanner(System.in);
        long N = scn.nextLong();
        long A = scn.nextLong();
        long B = scn.nextLong();
        
        if(A!=0){
            long tmp = (N/(A+B))*A;
            tmp += N%(A+B)<=A ? N%(A+B) : A;
            System.out.println(tmp);
        }
        else System.out.println(0);
    } Scanner scn = new Scanner(System.in); scn new Scanner(System.in) long N = scn.nextLong(); N scn.nextLong() scn.nextLong scn long A = scn.nextLong(); A scn.nextLong() scn.nextLong scn long B = scn.nextLong(); B scn.nextLong() scn.nextLong scn if(A!=0){
            long tmp = (N/(A+B))*A;
            tmp += N%(A+B)<=A ? N%(A+B) : A;
            System.out.println(tmp);
        }
        else System.out.println(0); A!=0 A 0 {
            long tmp = (N/(A+B))*A;
            tmp += N%(A+B)<=A ? N%(A+B) : A;
            System.out.println(tmp);
        } long tmp = (N/(A+B))*A; tmp (N/(A+B))*A (N/(A+B)) N (A+B) A B A tmp += N%(A+B)<=A ? N%(A+B) : A tmp N%(A+B)<=A ? N%(A+B) : A N%(A+B)<=A N%(A+B) N (A+B) A B A N%(A+B) N (A+B) A B A System.out.println(tmp) System.out.println System.out System System.out tmp System.out.println(0) System.out.println System.out System System.out 0 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scn = new Scanner(System.in);
        long N = scn.nextLong();
        long A = scn.nextLong();
        long B = scn.nextLong();
        
        if(A!=0){
            long tmp = (N/(A+B))*A;
            tmp += N%(A+B)<=A ? N%(A+B) : A;
            System.out.println(tmp);
        }
        else System.out.println(0);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scn = new Scanner(System.in);
        long N = scn.nextLong();
        long A = scn.nextLong();
        long B = scn.nextLong();
        
        if(A!=0){
            long tmp = (N/(A+B))*A;
            tmp += N%(A+B)<=A ? N%(A+B) : A;
            System.out.println(tmp);
        }
        else System.out.println(0);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scn = new Scanner(System.in);
        long N = scn.nextLong();
        long A = scn.nextLong();
        long B = scn.nextLong();
        
        if(A!=0){
            long tmp = (N/(A+B))*A;
            tmp += N%(A+B)<=A ? N%(A+B) : A;
            System.out.println(tmp);
        }
        else System.out.println(0);
    }
}
