import java.util.Scanner;

 
public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long rest = N % (A + B);
		long divide = Math.floorDiv(N, A + B);
		
		if(rest < A) {
			System.out.print(A * divide + rest);
		}else {
			System.out.print(A * divide + A);
		}
		sc.close();
	}
	
} import java.util.Scanner; Scanner java.util public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long rest = N % (A + B);
		long divide = Math.floorDiv(N, A + B);
		
		if(rest < A) {
			System.out.print(A * divide + rest);
		}else {
			System.out.print(A * divide + A);
		}
		sc.close();
	}
	
} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long rest = N % (A + B);
		long divide = Math.floorDiv(N, A + B);
		
		if(rest < A) {
			System.out.print(A * divide + rest);
		}else {
			System.out.print(A * divide + A);
		}
		sc.close();
	} main {
		
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long rest = N % (A + B);
		long divide = Math.floorDiv(N, A + B);
		
		if(rest < A) {
			System.out.print(A * divide + rest);
		}else {
			System.out.print(A * divide + A);
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc long B = sc.nextLong(); B sc.nextLong() sc.nextLong sc long rest = N % (A + B); rest N % (A + B) N (A + B) A B long divide = Math.floorDiv(N, A + B); divide Math.floorDiv(N, A + B) Math.floorDiv Math N A + B A B if(rest < A) {
			System.out.print(A * divide + rest);
		}else {
			System.out.print(A * divide + A);
		} rest < A rest A {
			System.out.print(A * divide + rest);
		} System.out.print(A * divide + rest) System.out.print System.out System System.out A * divide + rest A * divide A divide rest {
			System.out.print(A * divide + A);
		} System.out.print(A * divide + A) System.out.print System.out System System.out A * divide + A A * divide A divide A sc.close() sc.close sc String[] args args public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long rest = N % (A + B);
		long divide = Math.floorDiv(N, A + B);
		
		if(rest < A) {
			System.out.print(A * divide + rest);
		}else {
			System.out.print(A * divide + A);
		}
		sc.close();
	}
	
} public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long rest = N % (A + B);
		long divide = Math.floorDiv(N, A + B);
		
		if(rest < A) {
			System.out.print(A * divide + rest);
		}else {
			System.out.print(A * divide + A);
		}
		sc.close();
	}
	
} Main
import java.util.Scanner;

 
public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long rest = N % (A + B);
		long divide = Math.floorDiv(N, A + B);
		
		if(rest < A) {
			System.out.print(A * divide + rest);
		}else {
			System.out.print(A * divide + A);
		}
		sc.close();
	}
	
}