import java.math.*;
import java.util.*;
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();
        if(a==0){
            System.out.println(0);
        } else if(b==0){
            System.out.println(n);
        } else {
            long s = n/(a+b);
            if(n-s*(a+b)<=a){
                System.out.println(s*a+n-s*(a+b));
            } else {
                System.out.println(s*a+a);
            }
        }
	}
} import java.math.*; math.* java import java.util.*; util.* java 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();
        if(a==0){
            System.out.println(0);
        } else if(b==0){
            System.out.println(n);
        } else {
            long s = n/(a+b);
            if(n-s*(a+b)<=a){
                System.out.println(s*a+n-s*(a+b));
            } else {
                System.out.println(s*a+a);
            }
        }
	}
} 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();
        if(a==0){
            System.out.println(0);
        } else if(b==0){
            System.out.println(n);
        } else {
            long s = n/(a+b);
            if(n-s*(a+b)<=a){
                System.out.println(s*a+n-s*(a+b));
            } else {
                System.out.println(s*a+a);
            }
        }
	} main {
        Scanner sc=new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        if(a==0){
            System.out.println(0);
        } else if(b==0){
            System.out.println(n);
        } else {
            long s = n/(a+b);
            if(n-s*(a+b)<=a){
                System.out.println(s*a+n-s*(a+b));
            } else {
                System.out.println(s*a+a);
            }
        }
	} 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 if(a==0){
            System.out.println(0);
        } else if(b==0){
            System.out.println(n);
        } else {
            long s = n/(a+b);
            if(n-s*(a+b)<=a){
                System.out.println(s*a+n-s*(a+b));
            } else {
                System.out.println(s*a+a);
            }
        } a==0 a 0 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 if(b==0){
            System.out.println(n);
        } else {
            long s = n/(a+b);
            if(n-s*(a+b)<=a){
                System.out.println(s*a+n-s*(a+b));
            } else {
                System.out.println(s*a+a);
            }
        } b==0 b 0 {
            System.out.println(n);
        } System.out.println(n) System.out.println System.out System System.out n {
            long s = n/(a+b);
            if(n-s*(a+b)<=a){
                System.out.println(s*a+n-s*(a+b));
            } else {
                System.out.println(s*a+a);
            }
        } long s = n/(a+b); s n/(a+b) n (a+b) a b if(n-s*(a+b)<=a){
                System.out.println(s*a+n-s*(a+b));
            } else {
                System.out.println(s*a+a);
            } n-s*(a+b)<=a n-s*(a+b) n s*(a+b) s (a+b) a b a {
                System.out.println(s*a+n-s*(a+b));
            } System.out.println(s*a+n-s*(a+b)) System.out.println System.out System System.out s*a+n-s*(a+b) s*a+n s*a s a n s*(a+b) s (a+b) a b {
                System.out.println(s*a+a);
            } System.out.println(s*a+a) System.out.println System.out System System.out s*a+a s*a s a a String[] args args
import java.math.*;
import java.util.*;
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();
        if(a==0){
            System.out.println(0);
        } else if(b==0){
            System.out.println(n);
        } else {
            long s = n/(a+b);
            if(n-s*(a+b)<=a){
                System.out.println(s*a+n-s*(a+b));
            } else {
                System.out.println(s*a+a);
            }
        }
	}
}