// package app;

import java.util.Arrays;
import java.util.Objects;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        // final String s = sc.next();
        final long N = sc.nextLong();
        final long A = sc.nextLong();
        final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        // final int b = sc.nextInt();
        // final int D = sc.nextInt();
        // System.out.println();

        long result = 0;
        if(A == 0) {
            result = 0;
        } else if (B == 0) {
            result = N;
        }else {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        }

        System.out.println(result);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} import java.util.Arrays; Arrays java.util import java.util.Objects; Objects java.util import java.util.Scanner; Scanner java.util import java.util.stream.Stream; Stream java.util.stream public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        // final String s = sc.next();
        final long N = sc.nextLong();
        final long A = sc.nextLong();
        final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        // final int b = sc.nextInt();
        // final int D = sc.nextInt();
        // System.out.println();

        long result = 0;
        if(A == 0) {
            result = 0;
        } else if (B == 0) {
            result = N;
        }else {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        }

        System.out.println(result);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} Main public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        // final String s = sc.next();
        final long N = sc.nextLong();
        final long A = sc.nextLong();
        final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        // final int b = sc.nextInt();
        // final int D = sc.nextInt();
        // System.out.println();

        long result = 0;
        if(A == 0) {
            result = 0;
        } else if (B == 0) {
            result = N;
        }else {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        }

        System.out.println(result);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    } main {
        final Scanner sc = new Scanner(System.in);

        // final String s = sc.next();
        final long N = sc.nextLong();
        final long A = sc.nextLong();
        final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        // final int b = sc.nextInt();
        // final int D = sc.nextInt();
        // System.out.println();

        long result = 0;
        if(A == 0) {
            result = 0;
        } else if (B == 0) {
            result = N;
        }else {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        }

        System.out.println(result);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc final long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc final long B = sc.nextLong(); B sc.nextLong() sc.nextLong sc long result = 0; result 0 if(A == 0) {
            result = 0;
        } else if (B == 0) {
            result = N;
        }else {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        } A == 0 A 0 {
            result = 0;
        } result = 0 result 0 if (B == 0) {
            result = N;
        }else {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        } B == 0 B 0 {
            result = N;
        } result = N result N {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        } long sum = N / (A + B); sum N / (A + B) N (A + B) A B long remain = N % (A + B); remain N % (A + B) N (A + B) A B result = sum * A result sum * A sum A result += remain >= A ? A : remain result remain >= A ? A : remain remain >= A remain A A remain System.out.println(result) System.out.println System.out System System.out result final String[] args args public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        // final String s = sc.next();
        final long N = sc.nextLong();
        final long A = sc.nextLong();
        final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        // final int b = sc.nextInt();
        // final int D = sc.nextInt();
        // System.out.println();

        long result = 0;
        if(A == 0) {
            result = 0;
        } else if (B == 0) {
            result = N;
        }else {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        }

        System.out.println(result);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        // final String s = sc.next();
        final long N = sc.nextLong();
        final long A = sc.nextLong();
        final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        // final int b = sc.nextInt();
        // final int D = sc.nextInt();
        // System.out.println();

        long result = 0;
        if(A == 0) {
            result = 0;
        } else if (B == 0) {
            result = N;
        }else {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        }

        System.out.println(result);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} Main
// package app;

import java.util.Arrays;
import java.util.Objects;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        // final String s = sc.next();
        final long N = sc.nextLong();
        final long A = sc.nextLong();
        final long B = sc.nextLong();
        // final String s = sc.next();
        // final String b = sc.next();

        // final int b = sc.nextInt();
        // final int D = sc.nextInt();
        // System.out.println();

        long result = 0;
        if(A == 0) {
            result = 0;
        } else if (B == 0) {
            result = N;
        }else {
            long sum = N / (A + B);
            long remain = N % (A + B);
            result = sum * A;
            result += remain >= A ? A : remain;
        }

        System.out.println(result);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
}