import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        if (A <= 0) {
            System.out.println(0);
            return;
        }

        // 0 < A

        if (B <= 0) {
            System.out.println(N);
            return;
        }

        // 0 < A
        // 0 < B

        if (A >= N) {
            System.out.println(N);
            return;
        }

        // 0 < A < N
        // 0 < B

        if (B >= N) {
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N

        if (A + B >= N) {
            // 0 < A < N
            // 0 < B < N
            // 0 < N <= A + B
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N
        // 0 < A + B < N

        long sho = N / (A + B);
        long jouyo = N % (A + B);
        System.out.println(sho * A + Math.min(jouyo, A));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        if (A <= 0) {
            System.out.println(0);
            return;
        }

        // 0 < A

        if (B <= 0) {
            System.out.println(N);
            return;
        }

        // 0 < A
        // 0 < B

        if (A >= N) {
            System.out.println(N);
            return;
        }

        // 0 < A < N
        // 0 < B

        if (B >= N) {
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N

        if (A + B >= N) {
            // 0 < A < N
            // 0 < B < N
            // 0 < N <= A + B
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N
        // 0 < A + B < N

        long sho = N / (A + B);
        long jouyo = N % (A + B);
        System.out.println(sho * A + Math.min(jouyo, A));
    }
} Main public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        if (A <= 0) {
            System.out.println(0);
            return;
        }

        // 0 < A

        if (B <= 0) {
            System.out.println(N);
            return;
        }

        // 0 < A
        // 0 < B

        if (A >= N) {
            System.out.println(N);
            return;
        }

        // 0 < A < N
        // 0 < B

        if (B >= N) {
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N

        if (A + B >= N) {
            // 0 < A < N
            // 0 < B < N
            // 0 < N <= A + B
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N
        // 0 < A + B < N

        long sho = N / (A + B);
        long jouyo = N % (A + B);
        System.out.println(sho * A + Math.min(jouyo, A));
    } main {

        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        if (A <= 0) {
            System.out.println(0);
            return;
        }

        // 0 < A

        if (B <= 0) {
            System.out.println(N);
            return;
        }

        // 0 < A
        // 0 < B

        if (A >= N) {
            System.out.println(N);
            return;
        }

        // 0 < A < N
        // 0 < B

        if (B >= N) {
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N

        if (A + B >= N) {
            // 0 < A < N
            // 0 < B < N
            // 0 < N <= A + B
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N
        // 0 < A + B < N

        long sho = N / (A + B);
        long jouyo = N % (A + B);
        System.out.println(sho * A + Math.min(jouyo, A));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long N = scanner.nextLong(); N scanner.nextLong() scanner.nextLong scanner long A = scanner.nextLong(); A scanner.nextLong() scanner.nextLong scanner long B = scanner.nextLong(); B scanner.nextLong() scanner.nextLong scanner if (A <= 0) {
            System.out.println(0);
            return;
        } A <= 0 A 0 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; if (B <= 0) {
            System.out.println(N);
            return;
        } B <= 0 B 0 {
            System.out.println(N);
            return;
        } System.out.println(N) System.out.println System.out System System.out N return; if (A >= N) {
            System.out.println(N);
            return;
        } A >= N A N {
            System.out.println(N);
            return;
        } System.out.println(N) System.out.println System.out System System.out N return; if (B >= N) {
            System.out.println(A);
            return;
        } B >= N B N {
            System.out.println(A);
            return;
        } System.out.println(A) System.out.println System.out System System.out A return; if (A + B >= N) {
            // 0 < A < N
            // 0 < B < N
            // 0 < N <= A + B
            System.out.println(A);
            return;
        } A + B >= N A + B A B N {
            // 0 < A < N
            // 0 < B < N
            // 0 < N <= A + B
            System.out.println(A);
            return;
        } System.out.println(A) System.out.println System.out System System.out A return; long sho = N / (A + B); sho N / (A + B) N (A + B) A B long jouyo = N % (A + B); jouyo N % (A + B) N (A + B) A B System.out.println(sho * A + Math.min(jouyo, A)) System.out.println System.out System System.out sho * A + Math.min(jouyo, A) sho * A sho A Math.min(jouyo, A) Math.min Math jouyo A String[] args args public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        if (A <= 0) {
            System.out.println(0);
            return;
        }

        // 0 < A

        if (B <= 0) {
            System.out.println(N);
            return;
        }

        // 0 < A
        // 0 < B

        if (A >= N) {
            System.out.println(N);
            return;
        }

        // 0 < A < N
        // 0 < B

        if (B >= N) {
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N

        if (A + B >= N) {
            // 0 < A < N
            // 0 < B < N
            // 0 < N <= A + B
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N
        // 0 < A + B < N

        long sho = N / (A + B);
        long jouyo = N % (A + B);
        System.out.println(sho * A + Math.min(jouyo, A));
    }
} public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        if (A <= 0) {
            System.out.println(0);
            return;
        }

        // 0 < A

        if (B <= 0) {
            System.out.println(N);
            return;
        }

        // 0 < A
        // 0 < B

        if (A >= N) {
            System.out.println(N);
            return;
        }

        // 0 < A < N
        // 0 < B

        if (B >= N) {
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N

        if (A + B >= N) {
            // 0 < A < N
            // 0 < B < N
            // 0 < N <= A + B
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N
        // 0 < A + B < N

        long sho = N / (A + B);
        long jouyo = N % (A + B);
        System.out.println(sho * A + Math.min(jouyo, A));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();

        if (A <= 0) {
            System.out.println(0);
            return;
        }

        // 0 < A

        if (B <= 0) {
            System.out.println(N);
            return;
        }

        // 0 < A
        // 0 < B

        if (A >= N) {
            System.out.println(N);
            return;
        }

        // 0 < A < N
        // 0 < B

        if (B >= N) {
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N

        if (A + B >= N) {
            // 0 < A < N
            // 0 < B < N
            // 0 < N <= A + B
            System.out.println(A);
            return;
        }

        // 0 < A < N
        // 0 < B < N
        // 0 < A + B < N

        long sho = N / (A + B);
        long jouyo = N % (A + B);
        System.out.println(sho * A + Math.min(jouyo, A));
    }
}