import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = (long) (n / (a + b));
        long d = n % (a + b);
        if(d <= a){
            long l = a * c + d;
            System.out.println(l);
        }else{
            long l = a * (c + 1);
            System.out.println(l);
        }
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = (long) (n / (a + b));
        long d = n % (a + b);
        if(d <= a){
            long l = a * c + d;
            System.out.println(l);
        }else{
            long l = a * (c + 1);
            System.out.println(l);
        }
    }
} Main public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = (long) (n / (a + b));
        long d = n % (a + b);
        if(d <= a){
            long l = a * c + d;
            System.out.println(l);
        }else{
            long l = a * (c + 1);
            System.out.println(l);
        }
    } main {
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = (long) (n / (a + b));
        long d = n % (a + b);
        if(d <= a){
            long l = a * c + d;
            System.out.println(l);
        }else{
            long l = a * (c + 1);
            System.out.println(l);
        }
    } Scanner scan = new java.util.Scanner(System.in); scan new java.util.Scanner(System.in) long n = scan.nextLong(); n scan.nextLong() scan.nextLong scan long a = scan.nextLong(); a scan.nextLong() scan.nextLong scan long b = scan.nextLong(); b scan.nextLong() scan.nextLong scan long c = (long) (n / (a + b)); c (long) (n / (a + b)) n (a + b) a b long d = n % (a + b); d n % (a + b) n (a + b) a b if(d <= a){
            long l = a * c + d;
            System.out.println(l);
        }else{
            long l = a * (c + 1);
            System.out.println(l);
        } d <= a d a {
            long l = a * c + d;
            System.out.println(l);
        } long l = a * c + d; l a * c + d a * c a c d System.out.println(l) System.out.println System.out System System.out l {
            long l = a * (c + 1);
            System.out.println(l);
        } long l = a * (c + 1); l a * (c + 1) a (c + 1) c 1 System.out.println(l) System.out.println System.out System System.out l String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = (long) (n / (a + b));
        long d = n % (a + b);
        if(d <= a){
            long l = a * c + d;
            System.out.println(l);
        }else{
            long l = a * (c + 1);
            System.out.println(l);
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = (long) (n / (a + b));
        long d = n % (a + b);
        if(d <= a){
            long l = a * c + d;
            System.out.println(l);
        }else{
            long l = a * (c + 1);
            System.out.println(l);
        }
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = (long) (n / (a + b));
        long d = n % (a + b);
        if(d <= a){
            long l = a * c + d;
            System.out.println(l);
        }else{
            long l = a * (c + 1);
            System.out.println(l);
        }
    }
}