
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] arr = reader.readLine().split(" ");
        long N = Long.parseLong(arr[0]);
        long A = Long.parseLong(arr[1]);
        long B = Long.parseLong(arr[2]);
        long div = N / (A + B);
        long mod = N % (A + B);
        System.out.println(A * div + Math.min(A, mod));
    }
} import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] arr = reader.readLine().split(" ");
        long N = Long.parseLong(arr[0]);
        long A = Long.parseLong(arr[1]);
        long B = Long.parseLong(arr[2]);
        long div = N / (A + B);
        long mod = N % (A + B);
        System.out.println(A * div + Math.min(A, mod));
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] arr = reader.readLine().split(" ");
        long N = Long.parseLong(arr[0]);
        long A = Long.parseLong(arr[1]);
        long B = Long.parseLong(arr[2]);
        long div = N / (A + B);
        long mod = N % (A + B);
        System.out.println(A * div + Math.min(A, mod));
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] arr = reader.readLine().split(" ");
        long N = Long.parseLong(arr[0]);
        long A = Long.parseLong(arr[1]);
        long B = Long.parseLong(arr[2]);
        long div = N / (A + B);
        long mod = N % (A + B);
        System.out.println(A * div + Math.min(A, mod));
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String[] arr = reader.readLine().split(" "); arr reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " long N = Long.parseLong(arr[0]); N Long.parseLong(arr[0]) Long.parseLong Long arr[0] arr 0 long A = Long.parseLong(arr[1]); A Long.parseLong(arr[1]) Long.parseLong Long arr[1] arr 1 long B = Long.parseLong(arr[2]); B Long.parseLong(arr[2]) Long.parseLong Long arr[2] arr 2 long div = N / (A + B); div N / (A + B) N (A + B) A B long mod = N % (A + B); mod N % (A + B) N (A + B) A B System.out.println(A * div + Math.min(A, mod)) System.out.println System.out System System.out A * div + Math.min(A, mod) A * div A div Math.min(A, mod) Math.min Math A mod String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] arr = reader.readLine().split(" ");
        long N = Long.parseLong(arr[0]);
        long A = Long.parseLong(arr[1]);
        long B = Long.parseLong(arr[2]);
        long div = N / (A + B);
        long mod = N % (A + B);
        System.out.println(A * div + Math.min(A, mod));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] arr = reader.readLine().split(" ");
        long N = Long.parseLong(arr[0]);
        long A = Long.parseLong(arr[1]);
        long B = Long.parseLong(arr[2]);
        long div = N / (A + B);
        long mod = N % (A + B);
        System.out.println(A * div + Math.min(A, mod));
    }
} Main

import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] arr = reader.readLine().split(" ");
        long N = Long.parseLong(arr[0]);
        long A = Long.parseLong(arr[1]);
        long B = Long.parseLong(arr[2]);
        long div = N / (A + B);
        long mod = N % (A + B);
        System.out.println(A * div + Math.min(A, mod));
    }
}