import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();


        long base = N / (A + B);
        long mod = N % (A + B);
        if (mod >= A) mod = A;
       
        System.out.println(base * A + mod);

        return;
    }

} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
} Main public static void main(String[] args) {
        new Solver().run();
    } main {
        new Solver().run();
    } new Solver().run() new Solver().run new Solver() String[] args args class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();


        long base = N / (A + B);
        long mod = N % (A + B);
        if (mod >= A) mod = A;
       
        System.out.println(base * A + mod);

        return;
    }

} Solver public void run() {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();


        long base = N / (A + B);
        long mod = N % (A + B);
        if (mod >= A) mod = A;
       
        System.out.println(base * A + mod);

        return;
    } run {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();


        long base = N / (A + B);
        long mod = N % (A + B);
        if (mod >= A) mod = A;
       
        System.out.println(base * A + mod);

        return;
    } 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 long base = N / (A + B); base N / (A + B) N (A + B) A B long mod = N % (A + B); mod N % (A + B) N (A + B) A B if (mod >= A) mod = A; mod >= A mod A mod = A mod A System.out.println(base * A + mod) System.out.println System.out System System.out base * A + mod base * A base A mod return;
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();


        long base = N / (A + B);
        long mod = N % (A + B);
        if (mod >= A) mod = A;
       
        System.out.println(base * A + mod);

        return;
    }

}