import java.util.*;
import java.lang.*;
public class Main {
        public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            long n = scanner.nextLong();
            long a =scanner.nextLong();
            long b =scanner.nextLong();
            long totalPlaced=n/(a+b);
            long remainder=n%(a+b);
            long totalA=0;
            if(remainder>a){
                totalA+=a;
            }else{
                totalA+=remainder;
            }
            totalA+=(totalPlaced*a);
            System.out.println(totalA);

    }
}


 import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
        public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            long n = scanner.nextLong();
            long a =scanner.nextLong();
            long b =scanner.nextLong();
            long totalPlaced=n/(a+b);
            long remainder=n%(a+b);
            long totalA=0;
            if(remainder>a){
                totalA+=a;
            }else{
                totalA+=remainder;
            }
            totalA+=(totalPlaced*a);
            System.out.println(totalA);

    }
} Main public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            long n = scanner.nextLong();
            long a =scanner.nextLong();
            long b =scanner.nextLong();
            long totalPlaced=n/(a+b);
            long remainder=n%(a+b);
            long totalA=0;
            if(remainder>a){
                totalA+=a;
            }else{
                totalA+=remainder;
            }
            totalA+=(totalPlaced*a);
            System.out.println(totalA);

    } main {
            Scanner scanner = new Scanner(System.in);
            long n = scanner.nextLong();
            long a =scanner.nextLong();
            long b =scanner.nextLong();
            long totalPlaced=n/(a+b);
            long remainder=n%(a+b);
            long totalA=0;
            if(remainder>a){
                totalA+=a;
            }else{
                totalA+=remainder;
            }
            totalA+=(totalPlaced*a);
            System.out.println(totalA);

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long n = scanner.nextLong(); n scanner.nextLong() scanner.nextLong scanner long a =scanner.nextLong(); a scanner.nextLong() scanner.nextLong scanner long b =scanner.nextLong(); b scanner.nextLong() scanner.nextLong scanner long totalPlaced=n/(a+b); totalPlaced n/(a+b) n (a+b) a b long remainder=n%(a+b); remainder n%(a+b) n (a+b) a b long totalA=0; totalA 0 if(remainder>a){
                totalA+=a;
            }else{
                totalA+=remainder;
            } remainder>a remainder a {
                totalA+=a;
            } totalA+=a totalA a {
                totalA+=remainder;
            } totalA+=remainder totalA remainder totalA+=(totalPlaced*a) totalA (totalPlaced*a) totalPlaced a System.out.println(totalA) System.out.println System.out System System.out totalA String[]args args public class Main {
        public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            long n = scanner.nextLong();
            long a =scanner.nextLong();
            long b =scanner.nextLong();
            long totalPlaced=n/(a+b);
            long remainder=n%(a+b);
            long totalA=0;
            if(remainder>a){
                totalA+=a;
            }else{
                totalA+=remainder;
            }
            totalA+=(totalPlaced*a);
            System.out.println(totalA);

    }
} public class Main {
        public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            long n = scanner.nextLong();
            long a =scanner.nextLong();
            long b =scanner.nextLong();
            long totalPlaced=n/(a+b);
            long remainder=n%(a+b);
            long totalA=0;
            if(remainder>a){
                totalA+=a;
            }else{
                totalA+=remainder;
            }
            totalA+=(totalPlaced*a);
            System.out.println(totalA);

    }
} Main
import java.util.*;
import java.lang.*;
public class Main {
        public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            long n = scanner.nextLong();
            long a =scanner.nextLong();
            long b =scanner.nextLong();
            long totalPlaced=n/(a+b);
            long remainder=n%(a+b);
            long totalA=0;
            if(remainder>a){
                totalA+=a;
            }else{
                totalA+=remainder;
            }
            totalA+=(totalPlaced*a);
            System.out.println(totalA);

    }
}



