import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N, A, B;
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		sc.close();
		long a = N / (A + B);

		if (N % (A + B) == 0) {
			long b = a;
			System.out.println(A * b);
		} else {
			long b = a + 1;
			long c = b * (A + B);
			if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N, A, B;
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		sc.close();
		long a = N / (A + B);

		if (N % (A + B) == 0) {
			long b = a;
			System.out.println(A * b);
		} else {
			long b = a + 1;
			long c = b * (A + B);
			if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N, A, B;
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		sc.close();
		long a = N / (A + B);

		if (N % (A + B) == 0) {
			long b = a;
			System.out.println(A * b);
		} else {
			long b = a + 1;
			long c = b * (A + B);
			if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		long N, A, B;
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		sc.close();
		long a = N / (A + B);

		if (N % (A + B) == 0) {
			long b = a;
			System.out.println(A * b);
		} else {
			long b = a + 1;
			long c = b * (A + B);
			if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N N A A B; B N = sc.nextLong() N sc.nextLong() sc.nextLong sc A = sc.nextLong() A sc.nextLong() sc.nextLong sc B = sc.nextLong() B sc.nextLong() sc.nextLong sc sc.close() sc.close sc long a = N / (A + B); a N / (A + B) N (A + B) A B if (N % (A + B) == 0) {
			long b = a;
			System.out.println(A * b);
		} else {
			long b = a + 1;
			long c = b * (A + B);
			if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			}
		} N % (A + B) == 0 N % (A + B) N (A + B) A B 0 {
			long b = a;
			System.out.println(A * b);
		} long b = a; b a System.out.println(A * b) System.out.println System.out System System.out A * b A b {
			long b = a + 1;
			long c = b * (A + B);
			if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			}
		} long b = a + 1; b a + 1 a 1 long c = b * (A + B); c b * (A + B) b (A + B) A B if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			} c > N c N {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			} c = c - B c c - B c B if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				} c > N c N {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} c = c - N c c - N c N c=A-c c A-c A c System.out.println(A * (b-1) + c) System.out.println System.out System System.out A * (b-1) + c A * (b-1) A (b-1) b 1 c {
					System.out.println(A * b);
				} System.out.println(A * b) System.out.println System.out System System.out A * b A b String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N, A, B;
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		sc.close();
		long a = N / (A + B);

		if (N % (A + B) == 0) {
			long b = a;
			System.out.println(A * b);
		} else {
			long b = a + 1;
			long c = b * (A + B);
			if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N, A, B;
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		sc.close();
		long a = N / (A + B);

		if (N % (A + B) == 0) {
			long b = a;
			System.out.println(A * b);
		} else {
			long b = a + 1;
			long c = b * (A + B);
			if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N, A, B;
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		sc.close();
		long a = N / (A + B);

		if (N % (A + B) == 0) {
			long b = a;
			System.out.println(A * b);
		} else {
			long b = a + 1;
			long c = b * (A + B);
			if (c > N) {
				c = c - B;
				if (c > N) {
					c = c - N;
					c=A-c;
					System.out.println(A * (b-1) + c);
				} else {
					System.out.println(A * b);
				}
			}
		}
	}
}
