import java.util.Scanner;

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 count = 0;

		count = A*(N/(A+B));
		if(N%(A+B)>=A) {
			count = count + A;
		}else {
			count = count + N%(A+B);
		}
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util 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 count = 0;

		count = A*(N/(A+B));
		if(N%(A+B)>=A) {
			count = count + A;
		}else {
			count = count + N%(A+B);
		}
		System.out.println(count);
	}
} 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 count = 0;

		count = A*(N/(A+B));
		if(N%(A+B)>=A) {
			count = count + A;
		}else {
			count = count + N%(A+B);
		}
		System.out.println(count);
	} main {
		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long count = 0;

		count = A*(N/(A+B));
		if(N%(A+B)>=A) {
			count = count + A;
		}else {
			count = count + N%(A+B);
		}
		System.out.println(count);
	} 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 count = 0; count 0 count = A*(N/(A+B)) count A*(N/(A+B)) A (N/(A+B)) N (A+B) A B if(N%(A+B)>=A) {
			count = count + A;
		}else {
			count = count + N%(A+B);
		} N%(A+B)>=A N%(A+B) N (A+B) A B A {
			count = count + A;
		} count = count + A count count + A count A {
			count = count + N%(A+B);
		} count = count + N%(A+B) count count + N%(A+B) count N%(A+B) N (A+B) A B System.out.println(count) System.out.println System.out System System.out count 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 count = 0;

		count = A*(N/(A+B));
		if(N%(A+B)>=A) {
			count = count + A;
		}else {
			count = count + N%(A+B);
		}
		System.out.println(count);
	}
} 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 count = 0;

		count = A*(N/(A+B));
		if(N%(A+B)>=A) {
			count = count + A;
		}else {
			count = count + N%(A+B);
		}
		System.out.println(count);
	}
} Main
import java.util.Scanner;

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 count = 0;

		count = A*(N/(A+B));
		if(N%(A+B)>=A) {
			count = count + A;
		}else {
			count = count + N%(A+B);
		}
		System.out.println(count);
	}
}