import java.util.Scanner;

public class Main {


	public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		long n = getLong(sc);
		long a = getLong(sc);
		long b = getLong(sc);

		long blueBall = 0;
		blueBall += n / (a + b)*a;
		n = n % (a + b);
		if (n < a) {
			blueBall += n;
		} else {
			blueBall += a;
		}
		System.out.println(blueBall);
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

} import java.util.Scanner; Scanner java.util public class Main {


	public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		long n = getLong(sc);
		long a = getLong(sc);
		long b = getLong(sc);

		long blueBall = 0;
		blueBall += n / (a + b)*a;
		n = n % (a + b);
		if (n < a) {
			blueBall += n;
		} else {
			blueBall += a;
		}
		System.out.println(blueBall);
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

} Main public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		long n = getLong(sc);
		long a = getLong(sc);
		long b = getLong(sc);

		long blueBall = 0;
		blueBall += n / (a + b)*a;
		n = n % (a + b);
		if (n < a) {
			blueBall += n;
		} else {
			blueBall += a;
		}
		System.out.println(blueBall);
	} main {
		 Scanner sc = new Scanner(System.in);
		long n = getLong(sc);
		long a = getLong(sc);
		long b = getLong(sc);

		long blueBall = 0;
		blueBall += n / (a + b)*a;
		n = n % (a + b);
		if (n < a) {
			blueBall += n;
		} else {
			blueBall += a;
		}
		System.out.println(blueBall);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = getLong(sc); n getLong(sc) getLong sc long a = getLong(sc); a getLong(sc) getLong sc long b = getLong(sc); b getLong(sc) getLong sc long blueBall = 0; blueBall 0 blueBall += n / (a + b)*a blueBall n / (a + b)*a n / (a + b) n (a + b) a b a n = n % (a + b) n n % (a + b) n (a + b) a b if (n < a) {
			blueBall += n;
		} else {
			blueBall += a;
		} n < a n a {
			blueBall += n;
		} blueBall += n blueBall n {
			blueBall += a;
		} blueBall += a blueBall a System.out.println(blueBall) System.out.println System.out System System.out blueBall String[] args args /**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	} getLong {

		return Long.parseLong(sc.next());
	} return Long.parseLong(sc.next()); Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc Scanner sc sc public class Main {


	public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		long n = getLong(sc);
		long a = getLong(sc);
		long b = getLong(sc);

		long blueBall = 0;
		blueBall += n / (a + b)*a;
		n = n % (a + b);
		if (n < a) {
			blueBall += n;
		} else {
			blueBall += a;
		}
		System.out.println(blueBall);
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

} public class Main {


	public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		long n = getLong(sc);
		long a = getLong(sc);
		long b = getLong(sc);

		long blueBall = 0;
		blueBall += n / (a + b)*a;
		n = n % (a + b);
		if (n < a) {
			blueBall += n;
		} else {
			blueBall += a;
		}
		System.out.println(blueBall);
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

} Main
import java.util.Scanner;

public class Main {


	public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		long n = getLong(sc);
		long a = getLong(sc);
		long b = getLong(sc);

		long blueBall = 0;
		blueBall += n / (a + b)*a;
		n = n % (a + b);
		if (n < a) {
			blueBall += n;
		} else {
			blueBall += a;
		}
		System.out.println(blueBall);
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

}
