import java.util.*;
import java.lang.*;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
				
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long k = 0;

		if(1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18)){
			if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			}
		}
	}
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
				
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long k = 0;

		if(1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18)){
			if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			}
		}
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
				
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long k = 0;

		if(1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18)){
			if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			}
		}
	} main {
		Scanner scan = new Scanner(System.in);
				
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long k = 0;

		if(1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18)){
			if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			}
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long N = scan.nextLong(); N scan.nextLong() scan.nextLong scan long A = scan.nextLong(); A scan.nextLong() scan.nextLong scan long B = scan.nextLong(); B scan.nextLong() scan.nextLong scan long k = 0; k 0 if(1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18)){
			if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			}
		} 1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18) 0<A+B 0<=B 0<=A 1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18) 1<=N 1 N N<=Math.pow(10,18) N Math.pow(10,18) Math.pow Math 10 18 0<=A 0 A 0<=B 0 B 0<A+B 0 A+B A B A+B<=Math.pow(10,18) A+B A B Math.pow(10,18) Math.pow Math 10 18 {
			if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			}
		} if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			} A+B<=N A+B A B N {
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			} k = N/(A+B) k N/(A+B) N (A+B) A B if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				} N-k*(A+B)>A N-k*(A+B) N k*(A+B) k (A+B) A B A {
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				} System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A))) System.out.println System.out System System.out A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)) A*k + (N-k*(A+B)) A*k A k (N-k*(A+B)) N k*(A+B) k (A+B) A B (N-(k*(A+B)+A)) N (k*(A+B)+A) k*(A+B) k (A+B) A B A {
					System.out.println( A*k + (N-k*(A+B)));
				} System.out.println( A*k + (N-k*(A+B))) System.out.println System.out System System.out A*k + (N-k*(A+B)) A*k A k (N-k*(A+B)) N k*(A+B) k (A+B) A B if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			} A+B>N && A<=N A+B>N A+B A B N A<=N A N {
				System.out.println(A);
			} System.out.println(A) System.out.println System.out System System.out A {
				System.out.println(N);
			} System.out.println(N) System.out.println System.out System System.out N String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
				
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long k = 0;

		if(1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18)){
			if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			}
		}
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
				
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long k = 0;

		if(1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18)){
			if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			}
		}
	}
} Main
import java.util.*;
import java.lang.*;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
				
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long k = 0;

		if(1<=N && N<=Math.pow(10,18) && 0<=A && 0<=B && 0<A+B && A+B<=Math.pow(10,18)){
			if(A+B<=N){
				k = N/(A+B);
				
				if(N-k*(A+B)>A){
					System.out.println( A*k + (N-k*(A+B)) - (N-(k*(A+B)+A)));
				}
				else{
					System.out.println( A*k + (N-k*(A+B)));
				}
				
			}
			else if(A+B>N && A<=N){
				System.out.println(A);
			}
			else{
				System.out.println(N);
			}
		}
	}
}