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 sum = n / (a + b) * a;
		long remain = n % (a+b);

		if(remain < a) {
			sum += remain;
		}else {
			sum += a;
		}
		System.out.println(sum);
		scan.close();
	}

} 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 sum = n / (a + b) * a;
		long remain = n % (a+b);

		if(remain < a) {
			sum += remain;
		}else {
			sum += a;
		}
		System.out.println(sum);
		scan.close();
	}

} 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 sum = n / (a + b) * a;
		long remain = n % (a+b);

		if(remain < a) {
			sum += remain;
		}else {
			sum += a;
		}
		System.out.println(sum);
		scan.close();
	} main {

		Scanner scan = new Scanner(System.in);

		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long sum = n / (a + b) * a;
		long remain = n % (a+b);

		if(remain < a) {
			sum += remain;
		}else {
			sum += a;
		}
		System.out.println(sum);
		scan.close();
	} 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 sum = n / (a + b) * a; sum n / (a + b) * a n / (a + b) n (a + b) a b a long remain = n % (a+b); remain n % (a+b) n (a+b) a b if(remain < a) {
			sum += remain;
		}else {
			sum += a;
		} remain < a remain a {
			sum += remain;
		} sum += remain sum remain {
			sum += a;
		} sum += a sum a System.out.println(sum) System.out.println System.out System System.out sum scan.close() scan.close scan 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 sum = n / (a + b) * a;
		long remain = n % (a+b);

		if(remain < a) {
			sum += remain;
		}else {
			sum += a;
		}
		System.out.println(sum);
		scan.close();
	}

} 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 sum = n / (a + b) * a;
		long remain = n % (a+b);

		if(remain < a) {
			sum += remain;
		}else {
			sum += a;
		}
		System.out.println(sum);
		scan.close();
	}

} 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 sum = n / (a + b) * a;
		long remain = n % (a+b);

		if(remain < a) {
			sum += remain;
		}else {
			sum += a;
		}
		System.out.println(sum);
		scan.close();
	}

}
