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();

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

			}
		}
	}

} 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();

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

			}
		}
	}

} 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();

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

			}
		}
	} main {

		Scanner scan = new Scanner(System.in);

		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();

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

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

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

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

			} N % (A+B) < A N % (A+B) N (A+B) A B A {
				System.out.println(A*count + N % (A+B));
			} System.out.println(A*count + N % (A+B)) System.out.println System.out System System.out A*count + N % (A+B) A*count A count N % (A+B) N (A+B) A B {
				System.out.println(A*count + A);

			} System.out.println(A*count + A) System.out.println System.out System System.out A*count + A A*count A count A 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();

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

			}
		}
	}

} 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();

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

			}
		}
	}

} 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();

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

			}
		}
	}

}