import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	Long N = Long.parseLong(stdIn.next());
	Long A = Long.parseLong(stdIn.next());
	Long B =  Long.parseLong(stdIn.next());
	Long k = N/(A+B)*A;
	Long n =N%(A+B);
	Long j=Math.min(n,A);
	System.out.println(k+j);
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	Long N = Long.parseLong(stdIn.next());
	Long A = Long.parseLong(stdIn.next());
	Long B =  Long.parseLong(stdIn.next());
	Long k = N/(A+B)*A;
	Long n =N%(A+B);
	Long j=Math.min(n,A);
	System.out.println(k+j);
    }
} Main public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	Long N = Long.parseLong(stdIn.next());
	Long A = Long.parseLong(stdIn.next());
	Long B =  Long.parseLong(stdIn.next());
	Long k = N/(A+B)*A;
	Long n =N%(A+B);
	Long j=Math.min(n,A);
	System.out.println(k+j);
    } main {
	Scanner stdIn = new Scanner(System.in);
	Long N = Long.parseLong(stdIn.next());
	Long A = Long.parseLong(stdIn.next());
	Long B =  Long.parseLong(stdIn.next());
	Long k = N/(A+B)*A;
	Long n =N%(A+B);
	Long j=Math.min(n,A);
	System.out.println(k+j);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) Long N = Long.parseLong(stdIn.next()); N Long.parseLong(stdIn.next()) Long.parseLong Long stdIn.next() stdIn.next stdIn Long A = Long.parseLong(stdIn.next()); A Long.parseLong(stdIn.next()) Long.parseLong Long stdIn.next() stdIn.next stdIn Long B =  Long.parseLong(stdIn.next()); B Long.parseLong(stdIn.next()) Long.parseLong Long stdIn.next() stdIn.next stdIn Long k = N/(A+B)*A; k N/(A+B)*A N/(A+B) N (A+B) A B A Long n =N%(A+B); n N%(A+B) N (A+B) A B Long j=Math.min(n,A); j Math.min(n,A) Math.min Math n A System.out.println(k+j) System.out.println System.out System System.out k+j k j String[] args args
import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	Long N = Long.parseLong(stdIn.next());
	Long A = Long.parseLong(stdIn.next());
	Long B =  Long.parseLong(stdIn.next());
	Long k = N/(A+B)*A;
	Long n =N%(A+B);
	Long j=Math.min(n,A);
	System.out.println(k+j);
    }
}
