import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            long n = Long.parseLong(sc.next());
            long a = Long.parseLong(sc.next());
            long b = Long.parseLong(sc.next());

            long mod = n % (a + b);

            long ans = 0;
            if(mod <= a){
                ans = ((n - mod)/(a + b))*a + mod;
            }else{
                ans = ((n - mod)/(a + b))*a + a;
            }

            System.out.println(ans);

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
} import java.util.*; util.* java import java.math.*; math.* java class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            long n = Long.parseLong(sc.next());
            long a = Long.parseLong(sc.next());
            long b = Long.parseLong(sc.next());

            long mod = n % (a + b);

            long ans = 0;
            if(mod <= a){
                ans = ((n - mod)/(a + b))*a + mod;
            }else{
                ans = ((n - mod)/(a + b))*a + a;
            }

            System.out.println(ans);

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
} Main public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            long n = Long.parseLong(sc.next());
            long a = Long.parseLong(sc.next());
            long b = Long.parseLong(sc.next());

            long mod = n % (a + b);

            long ans = 0;
            if(mod <= a){
                ans = ((n - mod)/(a + b))*a + mod;
            }else{
                ans = ((n - mod)/(a + b))*a + a;
            }

            System.out.println(ans);

        }catch(Exception e){
            e.printStackTrace();
        }        
    } main {
        
        try(Scanner sc = new Scanner(System.in)){
 
            long n = Long.parseLong(sc.next());
            long a = Long.parseLong(sc.next());
            long b = Long.parseLong(sc.next());

            long mod = n % (a + b);

            long ans = 0;
            if(mod <= a){
                ans = ((n - mod)/(a + b))*a + mod;
            }else{
                ans = ((n - mod)/(a + b))*a + a;
            }

            System.out.println(ans);

        }catch(Exception e){
            e.printStackTrace();
        }        
    } try(Scanner sc = new Scanner(System.in)){
 
            long n = Long.parseLong(sc.next());
            long a = Long.parseLong(sc.next());
            long b = Long.parseLong(sc.next());

            long mod = n % (a + b);

            long ans = 0;
            if(mod <= a){
                ans = ((n - mod)/(a + b))*a + mod;
            }else{
                ans = ((n - mod)/(a + b))*a + a;
            }

            System.out.println(ans);

        }catch(Exception e){
            e.printStackTrace();
        } catch(Exception e){
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
 
            long n = Long.parseLong(sc.next());
            long a = Long.parseLong(sc.next());
            long b = Long.parseLong(sc.next());

            long mod = n % (a + b);

            long ans = 0;
            if(mod <= a){
                ans = ((n - mod)/(a + b))*a + mod;
            }else{
                ans = ((n - mod)/(a + b))*a + a;
            }

            System.out.println(ans);

        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) long n = Long.parseLong(sc.next()); n Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long a = Long.parseLong(sc.next()); a Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long b = Long.parseLong(sc.next()); b Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long mod = n % (a + b); mod n % (a + b) n (a + b) a b long ans = 0; ans 0 if(mod <= a){
                ans = ((n - mod)/(a + b))*a + mod;
            }else{
                ans = ((n - mod)/(a + b))*a + a;
            } mod <= a mod a {
                ans = ((n - mod)/(a + b))*a + mod;
            } ans = ((n - mod)/(a + b))*a + mod ans ((n - mod)/(a + b))*a + mod ((n - mod)/(a + b))*a ((n - mod)/(a + b)) (n - mod) n mod (a + b) a b a mod {
                ans = ((n - mod)/(a + b))*a + a;
            } ans = ((n - mod)/(a + b))*a + a ans ((n - mod)/(a + b))*a + a ((n - mod)/(a + b))*a ((n - mod)/(a + b)) (n - mod) n mod (a + b) a b a a System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            long n = Long.parseLong(sc.next());
            long a = Long.parseLong(sc.next());
            long b = Long.parseLong(sc.next());

            long mod = n % (a + b);

            long ans = 0;
            if(mod <= a){
                ans = ((n - mod)/(a + b))*a + mod;
            }else{
                ans = ((n - mod)/(a + b))*a + a;
            }

            System.out.println(ans);

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}