import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner cin = new Scanner(System.in);
        String[] line = cin.nextLine().split(" ");
        long N = Long.parseLong(line[0]);
        long A = Long.parseLong(line[1]);
        long B = Long.parseLong(line[2]);

        long ans = N/(A+B) * A + Math.min(A, N%(A+B));
        System.out.println(ans);
        cin.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        Scanner cin = new Scanner(System.in);
        String[] line = cin.nextLine().split(" ");
        long N = Long.parseLong(line[0]);
        long A = Long.parseLong(line[1]);
        long B = Long.parseLong(line[2]);

        long ans = N/(A+B) * A + Math.min(A, N%(A+B));
        System.out.println(ans);
        cin.close();
    }
} Main public static void main(String[] args) throws Exception {
        Scanner cin = new Scanner(System.in);
        String[] line = cin.nextLine().split(" ");
        long N = Long.parseLong(line[0]);
        long A = Long.parseLong(line[1]);
        long B = Long.parseLong(line[2]);

        long ans = N/(A+B) * A + Math.min(A, N%(A+B));
        System.out.println(ans);
        cin.close();
    } main {
        Scanner cin = new Scanner(System.in);
        String[] line = cin.nextLine().split(" ");
        long N = Long.parseLong(line[0]);
        long A = Long.parseLong(line[1]);
        long B = Long.parseLong(line[2]);

        long ans = N/(A+B) * A + Math.min(A, N%(A+B));
        System.out.println(ans);
        cin.close();
    } Scanner cin = new Scanner(System.in); cin new Scanner(System.in) String[] line = cin.nextLine().split(" "); line cin.nextLine().split(" ") cin.nextLine().split cin.nextLine() cin.nextLine cin " " long N = Long.parseLong(line[0]); N Long.parseLong(line[0]) Long.parseLong Long line[0] line 0 long A = Long.parseLong(line[1]); A Long.parseLong(line[1]) Long.parseLong Long line[1] line 1 long B = Long.parseLong(line[2]); B Long.parseLong(line[2]) Long.parseLong Long line[2] line 2 long ans = N/(A+B) * A + Math.min(A, N%(A+B)); ans N/(A+B) * A + Math.min(A, N%(A+B)) N/(A+B) * A N/(A+B) N (A+B) A B A Math.min(A, N%(A+B)) Math.min Math A N%(A+B) N (A+B) A B System.out.println(ans) System.out.println System.out System System.out ans cin.close() cin.close cin String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner cin = new Scanner(System.in);
        String[] line = cin.nextLine().split(" ");
        long N = Long.parseLong(line[0]);
        long A = Long.parseLong(line[1]);
        long B = Long.parseLong(line[2]);

        long ans = N/(A+B) * A + Math.min(A, N%(A+B));
        System.out.println(ans);
        cin.close();
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner cin = new Scanner(System.in);
        String[] line = cin.nextLine().split(" ");
        long N = Long.parseLong(line[0]);
        long A = Long.parseLong(line[1]);
        long B = Long.parseLong(line[2]);

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner cin = new Scanner(System.in);
        String[] line = cin.nextLine().split(" ");
        long N = Long.parseLong(line[0]);
        long A = Long.parseLong(line[1]);
        long B = Long.parseLong(line[2]);

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