import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong(), a = scanner.nextLong(), b = scanner.nextLong();
        if (n <= a + b || a == 0){
            System.out.println(Math.min(n, a));
        }
        else {
            if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong(), a = scanner.nextLong(), b = scanner.nextLong();
        if (n <= a + b || a == 0){
            System.out.println(Math.min(n, a));
        }
        else {
            if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a);
        }
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong(), a = scanner.nextLong(), b = scanner.nextLong();
        if (n <= a + b || a == 0){
            System.out.println(Math.min(n, a));
        }
        else {
            if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a);
        }
    } main {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong(), a = scanner.nextLong(), b = scanner.nextLong();
        if (n <= a + b || a == 0){
            System.out.println(Math.min(n, a));
        }
        else {
            if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a);
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long n = scanner.nextLong() n scanner.nextLong() scanner.nextLong scanner a = scanner.nextLong() a scanner.nextLong() scanner.nextLong scanner b = scanner.nextLong(); b scanner.nextLong() scanner.nextLong scanner if (n <= a + b || a == 0){
            System.out.println(Math.min(n, a));
        }
        else {
            if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a);
        } n <= a + b || a == 0 n <= a + b n a + b a b a == 0 a 0 {
            System.out.println(Math.min(n, a));
        } System.out.println(Math.min(n, a)) System.out.println System.out System System.out Math.min(n, a) Math.min Math n a {
            if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a);
        } if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a); n % (a+b) <= a n % (a+b) n (a+b) a b a {
                System.out.println(n/(a + b) * a + n % (a+b));
            } System.out.println(n/(a + b) * a + n % (a+b)) System.out.println System.out System System.out n/(a + b) * a + n % (a+b) n/(a + b) * a n/(a + b) n (a + b) a b a n % (a+b) n (a+b) a b System.out.println(n/(a + b) * a + a) System.out.println System.out System System.out n/(a + b) * a + a n/(a + b) * a n/(a + b) n (a + b) a b a a String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong(), a = scanner.nextLong(), b = scanner.nextLong();
        if (n <= a + b || a == 0){
            System.out.println(Math.min(n, a));
        }
        else {
            if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong(), a = scanner.nextLong(), b = scanner.nextLong();
        if (n <= a + b || a == 0){
            System.out.println(Math.min(n, a));
        }
        else {
            if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong(), a = scanner.nextLong(), b = scanner.nextLong();
        if (n <= a + b || a == 0){
            System.out.println(Math.min(n, a));
        }
        else {
            if (n % (a+b) <= a){
                System.out.println(n/(a + b) * a + n % (a+b));
            }else
                System.out.println(n/(a + b) * a + a);
        }
    }
}
