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);
			}
		}
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz