import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long rem = N % (A + B);
        long result = (N - rem) / (A + B) * A;
        if (rem - A >= 0) {
            result += A;
        } else {
            result += rem;
        }
        System.out.println(result);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long rem = N % (A + B);
        long result = (N - rem) / (A + B) * A;
        if (rem - A >= 0) {
            result += A;
        } else {
            result += rem;
        }
        System.out.println(result);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long rem = N % (A + B);
        long result = (N - rem) / (A + B) * A;
        if (rem - A >= 0) {
            result += A;
        } else {
            result += rem;
        }
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long rem = N % (A + B);
        long result = (N - rem) / (A + B) * A;
        if (rem - A >= 0) {
            result += A;
        } else {
            result += rem;
        }
        System.out.println(result);
    } 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 rem = N % (A + B); rem N % (A + B) N (A + B) A B long result = (N - rem) / (A + B) * A; result (N - rem) / (A + B) * A (N - rem) / (A + B) (N - rem) N rem (A + B) A B A if (rem - A >= 0) {
            result += A;
        } else {
            result += rem;
        } rem - A >= 0 rem - A rem A 0 {
            result += A;
        } result += A result A {
            result += rem;
        } result += rem result rem System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long rem = N % (A + B);
        long result = (N - rem) / (A + B) * A;
        if (rem - A >= 0) {
            result += A;
        } else {
            result += rem;
        }
        System.out.println(result);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long rem = N % (A + B);
        long result = (N - rem) / (A + B) * A;
        if (rem - A >= 0) {
            result += A;
        } else {
            result += rem;
        }
        System.out.println(result);
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long rem = N % (A + B);
        long result = (N - rem) / (A + B) * A;
        if (rem - A >= 0) {
            result += A;
        } else {
            result += rem;
        }
        System.out.println(result);
    }

}
