import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		
		long cnt=N/(A+B);
		long amari=N%(A+B);
		long x=0;
		
		if(amari>=A) {
			x=A;
		}
		else {
			x=amari;
		}
		System.out.println(A*cnt+x);
		
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		
		long cnt=N/(A+B);
		long amari=N%(A+B);
		long x=0;
		
		if(amari>=A) {
			x=A;
		}
		else {
			x=amari;
		}
		System.out.println(A*cnt+x);
		
	}
} Main public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		
		long cnt=N/(A+B);
		long amari=N%(A+B);
		long x=0;
		
		if(amari>=A) {
			x=A;
		}
		else {
			x=amari;
		}
		System.out.println(A*cnt+x);
		
	} main {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		
		long cnt=N/(A+B);
		long amari=N%(A+B);
		long x=0;
		
		if(amari>=A) {
			x=A;
		}
		else {
			x=amari;
		}
		System.out.println(A*cnt+x);
		
	} Scanner input = new Scanner(System.in); input new Scanner(System.in) long N = input.nextLong(); N input.nextLong() input.nextLong input long A = input.nextLong(); A input.nextLong() input.nextLong input long B = input.nextLong(); B input.nextLong() input.nextLong input long cnt=N/(A+B); cnt N/(A+B) N (A+B) A B long amari=N%(A+B); amari N%(A+B) N (A+B) A B long x=0; x 0 if(amari>=A) {
			x=A;
		}
		else {
			x=amari;
		} amari>=A amari A {
			x=A;
		} x=A x A {
			x=amari;
		} x=amari x amari System.out.println(A*cnt+x) System.out.println System.out System System.out A*cnt+x A*cnt A cnt x String[] args args public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		
		long cnt=N/(A+B);
		long amari=N%(A+B);
		long x=0;
		
		if(amari>=A) {
			x=A;
		}
		else {
			x=amari;
		}
		System.out.println(A*cnt+x);
		
	}
} public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		
		long cnt=N/(A+B);
		long amari=N%(A+B);
		long x=0;
		
		if(amari>=A) {
			x=A;
		}
		else {
			x=amari;
		}
		System.out.println(A*cnt+x);
		
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		
		long cnt=N/(A+B);
		long amari=N%(A+B);
		long x=0;
		
		if(amari>=A) {
			x=A;
		}
		else {
			x=amari;
		}
		System.out.println(A*cnt+x);
		
	}
}
