import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		if (a == 0) {
			System.out.println(0);
			return;
		}

		if (b == 0) {
			System.out.println(n);
			return;
		}

		long q = n / (a + b);
		long r = n % (a + b);
		long ans = (r == 0) ? a * q : (r < a) ? a * q + r : a * q + a;
		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		if (a == 0) {
			System.out.println(0);
			return;
		}

		if (b == 0) {
			System.out.println(n);
			return;
		}

		long q = n / (a + b);
		long r = n % (a + b);
		long ans = (r == 0) ? a * q : (r < a) ? a * q + r : a * q + a;
		System.out.println(ans);
	}

} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		if (a == 0) {
			System.out.println(0);
			return;
		}

		if (b == 0) {
			System.out.println(n);
			return;
		}

		long q = n / (a + b);
		long r = n % (a + b);
		long ans = (r == 0) ? a * q : (r < a) ? a * q + r : a * q + a;
		System.out.println(ans);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		if (a == 0) {
			System.out.println(0);
			return;
		}

		if (b == 0) {
			System.out.println(n);
			return;
		}

		long q = n / (a + b);
		long r = n % (a + b);
		long ans = (r == 0) ? a * q : (r < a) ? a * q + r : a * q + a;
		System.out.println(ans);
	} long n = Long.parseLong(sc.next()); n Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long a = Long.parseLong(sc.next()); a Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long b = Long.parseLong(sc.next()); b Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc if (a == 0) {
			System.out.println(0);
			return;
		} a == 0 a 0 {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; if (b == 0) {
			System.out.println(n);
			return;
		} b == 0 b 0 {
			System.out.println(n);
			return;
		} System.out.println(n) System.out.println System.out System System.out n return; long q = n / (a + b); q n / (a + b) n (a + b) a b long r = n % (a + b); r n % (a + b) n (a + b) a b long ans = (r == 0) ? a * q : (r < a) ? a * q + r : a * q + a; ans (r == 0) ? a * q : (r < a) ? a * q + r : a * q + a (r == 0) r 0 a * q a q (r < a) ? a * q + r : a * q + a (r < a) r a a * q + r a * q a q r a * q + a a * q a q a System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		if (a == 0) {
			System.out.println(0);
			return;
		}

		if (b == 0) {
			System.out.println(n);
			return;
		}

		long q = n / (a + b);
		long r = n % (a + b);
		long ans = (r == 0) ? a * q : (r < a) ? a * q + r : a * q + a;
		System.out.println(ans);
	}

} public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		if (a == 0) {
			System.out.println(0);
			return;
		}

		if (b == 0) {
			System.out.println(n);
			return;
		}

		long q = n / (a + b);
		long r = n % (a + b);
		long ans = (r == 0) ? a * q : (r < a) ? a * q + r : a * q + a;
		System.out.println(ans);
	}

} Main
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		if (a == 0) {
			System.out.println(0);
			return;
		}

		if (b == 0) {
			System.out.println(n);
			return;
		}

		long q = n / (a + b);
		long r = n % (a + b);
		long ans = (r == 0) ? a * q : (r < a) ? a * q + r : a * q + a;
		System.out.println(ans);
	}

}
