import java.math.BigInteger;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        BigInteger n = new BigInteger(sc.next());
        BigInteger a_blue = new BigInteger(sc.next());
        BigInteger b_red = new BigInteger(sc.next());
        BigInteger absum = a_blue.add(b_red);
        BigInteger div = n.divide(absum);
        BigInteger rem = n.remainder(absum);
        BigInteger answer = div.multiply(a_blue).add(rem.min(a_blue));
        System.out.println(answer);
        sc.close();
    }
} import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        BigInteger n = new BigInteger(sc.next());
        BigInteger a_blue = new BigInteger(sc.next());
        BigInteger b_red = new BigInteger(sc.next());
        BigInteger absum = a_blue.add(b_red);
        BigInteger div = n.divide(absum);
        BigInteger rem = n.remainder(absum);
        BigInteger answer = div.multiply(a_blue).add(rem.min(a_blue));
        System.out.println(answer);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        BigInteger n = new BigInteger(sc.next());
        BigInteger a_blue = new BigInteger(sc.next());
        BigInteger b_red = new BigInteger(sc.next());
        BigInteger absum = a_blue.add(b_red);
        BigInteger div = n.divide(absum);
        BigInteger rem = n.remainder(absum);
        BigInteger answer = div.multiply(a_blue).add(rem.min(a_blue));
        System.out.println(answer);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        BigInteger n = new BigInteger(sc.next());
        BigInteger a_blue = new BigInteger(sc.next());
        BigInteger b_red = new BigInteger(sc.next());
        BigInteger absum = a_blue.add(b_red);
        BigInteger div = n.divide(absum);
        BigInteger rem = n.remainder(absum);
        BigInteger answer = div.multiply(a_blue).add(rem.min(a_blue));
        System.out.println(answer);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) BigInteger n = new BigInteger(sc.next()); n new BigInteger(sc.next()) BigInteger a_blue = new BigInteger(sc.next()); a_blue new BigInteger(sc.next()) BigInteger b_red = new BigInteger(sc.next()); b_red new BigInteger(sc.next()) BigInteger absum = a_blue.add(b_red); absum a_blue.add(b_red) a_blue.add a_blue b_red BigInteger div = n.divide(absum); div n.divide(absum) n.divide n absum BigInteger rem = n.remainder(absum); rem n.remainder(absum) n.remainder n absum BigInteger answer = div.multiply(a_blue).add(rem.min(a_blue)); answer div.multiply(a_blue).add(rem.min(a_blue)) div.multiply(a_blue).add div.multiply(a_blue) div.multiply div a_blue rem.min(a_blue) rem.min rem a_blue System.out.println(answer) System.out.println System.out System System.out answer sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        BigInteger n = new BigInteger(sc.next());
        BigInteger a_blue = new BigInteger(sc.next());
        BigInteger b_red = new BigInteger(sc.next());
        BigInteger absum = a_blue.add(b_red);
        BigInteger div = n.divide(absum);
        BigInteger rem = n.remainder(absum);
        BigInteger answer = div.multiply(a_blue).add(rem.min(a_blue));
        System.out.println(answer);
        sc.close();
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        BigInteger n = new BigInteger(sc.next());
        BigInteger a_blue = new BigInteger(sc.next());
        BigInteger b_red = new BigInteger(sc.next());
        BigInteger absum = a_blue.add(b_red);
        BigInteger div = n.divide(absum);
        BigInteger rem = n.remainder(absum);
        BigInteger answer = div.multiply(a_blue).add(rem.min(a_blue));
        System.out.println(answer);
        sc.close();
    }
} Main
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        BigInteger n = new BigInteger(sc.next());
        BigInteger a_blue = new BigInteger(sc.next());
        BigInteger b_red = new BigInteger(sc.next());
        BigInteger absum = a_blue.add(b_red);
        BigInteger div = n.divide(absum);
        BigInteger rem = n.remainder(absum);
        BigInteger answer = div.multiply(a_blue).add(rem.min(a_blue));
        System.out.println(answer);
        sc.close();
    }
}
