import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                long n = sc.nextLong();
                long a = sc.nextLong();
                long b = sc.nextLong();
                sc.close();
                long c = n / (a + b);
                long s = c * a;
                long d = n % (a + b);
        if(d > a){
                s = s + a;
        }else{
                s = s + d;
        }
        System.out.println(s);
        }
}
//鶏になれ import java.util.*; util.* java public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                long n = sc.nextLong();
                long a = sc.nextLong();
                long b = sc.nextLong();
                sc.close();
                long c = n / (a + b);
                long s = c * a;
                long d = n % (a + b);
        if(d > a){
                s = s + a;
        }else{
                s = s + d;
        }
        System.out.println(s);
        }
} Main public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                long n = sc.nextLong();
                long a = sc.nextLong();
                long b = sc.nextLong();
                sc.close();
                long c = n / (a + b);
                long s = c * a;
                long d = n % (a + b);
        if(d > a){
                s = s + a;
        }else{
                s = s + d;
        }
        System.out.println(s);
        } main {
                Scanner sc = new Scanner(System.in);
                long n = sc.nextLong();
                long a = sc.nextLong();
                long b = sc.nextLong();
                sc.close();
                long c = n / (a + b);
                long s = c * a;
                long d = n % (a + b);
        if(d > a){
                s = s + a;
        }else{
                s = s + d;
        }
        System.out.println(s);
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc sc.close() sc.close sc long c = n / (a + b); c n / (a + b) n (a + b) a b long s = c * a; s c * a c a long d = n % (a + b); d n % (a + b) n (a + b) a b if(d > a){
                s = s + a;
        }else{
                s = s + d;
        } d > a d a {
                s = s + a;
        } s = s + a s s + a s a {
                s = s + d;
        } s = s + d s s + d s d System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                long n = sc.nextLong();
                long a = sc.nextLong();
                long b = sc.nextLong();
                sc.close();
                long c = n / (a + b);
                long s = c * a;
                long d = n % (a + b);
        if(d > a){
                s = s + a;
        }else{
                s = s + d;
        }
        System.out.println(s);
        }
} public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                long n = sc.nextLong();
                long a = sc.nextLong();
                long b = sc.nextLong();
                sc.close();
                long c = n / (a + b);
                long s = c * a;
                long d = n % (a + b);
        if(d > a){
                s = s + a;
        }else{
                s = s + d;
        }
        System.out.println(s);
        }
} Main
import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                long n = sc.nextLong();
                long a = sc.nextLong();
                long b = sc.nextLong();
                sc.close();
                long c = n / (a + b);
                long s = c * a;
                long d = n % (a + b);
        if(d > a){
                s = s + a;
        }else{
                s = s + d;
        }
        System.out.println(s);
        }
}
//鶏になれ