import java.util.Scanner;

/**
 * Station and Bus
 * 
 * https://atcoder.jp/contests/abc158/tasks/abc158_a
 */
public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) throws Exception {
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long m = N / (A + B);

        long ans = A * m + Math.min(A, N - (A + B) * m);

        System.out.println(ans);
    }

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

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) throws Exception {
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long m = N / (A + B);

        long ans = A * m + Math.min(A, N - (A + B) * m);

        System.out.println(ans);
    }

} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) throws Exception {
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long m = N / (A + B);

        long ans = A * m + Math.min(A, N - (A + B) * m);

        System.out.println(ans);
    } main {
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long m = N / (A + B);

        long ans = A * m + Math.min(A, N - (A + B) * m);

        System.out.println(ans);
    } 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 m = N / (A + B); m N / (A + B) N (A + B) A B long ans = A * m + Math.min(A, N - (A + B) * m); ans A * m + Math.min(A, N - (A + B) * m) A * m A m Math.min(A, N - (A + B) * m) Math.min Math A N - (A + B) * m N (A + B) * m (A + B) A B m System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) throws Exception {
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long m = N / (A + B);

        long ans = A * m + Math.min(A, N - (A + B) * m);

        System.out.println(ans);
    }

} public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) throws Exception {
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long m = N / (A + B);

        long ans = A * m + Math.min(A, N - (A + B) * m);

        System.out.println(ans);
    }

} Main
import java.util.Scanner;

/**
 * Station and Bus
 * 
 * https://atcoder.jp/contests/abc158/tasks/abc158_a
 */
public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) throws Exception {
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long m = N / (A + B);

        long ans = A * m + Math.min(A, N - (A + B) * m);

        System.out.println(ans);
    }

}
