import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
       
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong(), blue = sc.nextLong(), red = sc.nextLong();
        
        long count = n / (blue + red);
        long rem = n % (blue + red);
        
        if(blue == 0){
            System.out.println(blue);
        } else if(n < (blue + red)) {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } else {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
       
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong(), blue = sc.nextLong(), red = sc.nextLong();
        
        long count = n / (blue + red);
        long rem = n % (blue + red);
        
        if(blue == 0){
            System.out.println(blue);
        } else if(n < (blue + red)) {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } else {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
       
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong(), blue = sc.nextLong(), red = sc.nextLong();
        
        long count = n / (blue + red);
        long rem = n % (blue + red);
        
        if(blue == 0){
            System.out.println(blue);
        } else if(n < (blue + red)) {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } else {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        }
    } main {
       
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong(), blue = sc.nextLong(), red = sc.nextLong();
        
        long count = n / (blue + red);
        long rem = n % (blue + red);
        
        if(blue == 0){
            System.out.println(blue);
        } else if(n < (blue + red)) {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } else {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong() n sc.nextLong() sc.nextLong sc blue = sc.nextLong() blue sc.nextLong() sc.nextLong sc red = sc.nextLong(); red sc.nextLong() sc.nextLong sc long count = n / (blue + red); count n / (blue + red) n (blue + red) blue red long rem = n % (blue + red); rem n % (blue + red) n (blue + red) blue red if(blue == 0){
            System.out.println(blue);
        } else if(n < (blue + red)) {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } else {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        } blue == 0 blue 0 {
            System.out.println(blue);
        } System.out.println(blue) System.out.println System.out System System.out blue if(n < (blue + red)) {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } else {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        } n < (blue + red) n (blue + red) blue red {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            } n>blue n blue {
                System.out.println(blue);
            } System.out.println(blue) System.out.println System.out System System.out blue {
                System.out.println(n);
            } System.out.println(n) System.out.println System.out System System.out n {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        } if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            } rem > blue rem blue {
                System.out.println((count * blue) + blue);
            } System.out.println((count * blue) + blue) System.out.println System.out System System.out (count * blue) + blue (count * blue) count blue blue {
                System.out.println((count * blue) + rem);    
            } System.out.println((count * blue) + rem) System.out.println System.out System System.out (count * blue) + rem (count * blue) count blue rem String[] args args public class Main {
    public static void main(String[] args) throws Exception {
       
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong(), blue = sc.nextLong(), red = sc.nextLong();
        
        long count = n / (blue + red);
        long rem = n % (blue + red);
        
        if(blue == 0){
            System.out.println(blue);
        } else if(n < (blue + red)) {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } else {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
       
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong(), blue = sc.nextLong(), red = sc.nextLong();
        
        long count = n / (blue + red);
        long rem = n % (blue + red);
        
        if(blue == 0){
            System.out.println(blue);
        } else if(n < (blue + red)) {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } else {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
       
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong(), blue = sc.nextLong(), red = sc.nextLong();
        
        long count = n / (blue + red);
        long rem = n % (blue + red);
        
        if(blue == 0){
            System.out.println(blue);
        } else if(n < (blue + red)) {
            if(n>blue){
                System.out.println(blue);
            } else {
                System.out.println(n);
            }
        } else {
            if(rem > blue){
                System.out.println((count * blue) + blue);
            } else {
                System.out.println((count * blue) + rem);    
            }
        }
    }
}
