import java.util.Scanner;

public 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();

        if(n%(a+b) < a){
            System.out.println((n/(a+b)*a)+(n%(a+b)));
        }else{
            System.out.println((n/(a+b)*a)+a);
        }
    }
} import java.util.Scanner; Scanner java.util public 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();

        if(n%(a+b) < a){
            System.out.println((n/(a+b)*a)+(n%(a+b)));
        }else{
            System.out.println((n/(a+b)*a)+a);
        }
    }
} 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();

        if(n%(a+b) < a){
            System.out.println((n/(a+b)*a)+(n%(a+b)));
        }else{
            System.out.println((n/(a+b)*a)+a);
        }
    } main {
        Scanner stdIn = new Scanner(System.in);

        long n = stdIn.nextLong();
        long a = stdIn.nextLong();
        long b = stdIn.nextLong();

        if(n%(a+b) < a){
            System.out.println((n/(a+b)*a)+(n%(a+b)));
        }else{
            System.out.println((n/(a+b)*a)+a);
        }
    } 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 if(n%(a+b) < a){
            System.out.println((n/(a+b)*a)+(n%(a+b)));
        }else{
            System.out.println((n/(a+b)*a)+a);
        } n%(a+b) < a n%(a+b) n (a+b) a b a {
            System.out.println((n/(a+b)*a)+(n%(a+b)));
        } System.out.println((n/(a+b)*a)+(n%(a+b))) System.out.println System.out System System.out (n/(a+b)*a)+(n%(a+b)) (n/(a+b)*a) n/(a+b) n (a+b) a b a (n%(a+b)) n (a+b) a b {
            System.out.println((n/(a+b)*a)+a);
        } System.out.println((n/(a+b)*a)+a) System.out.println System.out System System.out (n/(a+b)*a)+a (n/(a+b)*a) n/(a+b) n (a+b) a b a a String[] args args public 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();

        if(n%(a+b) < a){
            System.out.println((n/(a+b)*a)+(n%(a+b)));
        }else{
            System.out.println((n/(a+b)*a)+a);
        }
    }
} public 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();

        if(n%(a+b) < a){
            System.out.println((n/(a+b)*a)+(n%(a+b)));
        }else{
            System.out.println((n/(a+b)*a)+a);
        }
    }
} Main
import java.util.Scanner;

public 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();

        if(n%(a+b) < a){
            System.out.println((n/(a+b)*a)+(n%(a+b)));
        }else{
            System.out.println((n/(a+b)*a)+a);
        }
    }
}