import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		long n = kb.nextLong();
		long a = kb.nextLong();
		long b = kb.nextLong();
		long count = n / (a + b);
		if (a == 0)
			System.out.println(0);
		else if (0 < a && a <= n) {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} else {
			System.out.println(n);
		}
		kb.close();
	}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		long n = kb.nextLong();
		long a = kb.nextLong();
		long b = kb.nextLong();
		long count = n / (a + b);
		if (a == 0)
			System.out.println(0);
		else if (0 < a && a <= n) {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} else {
			System.out.println(n);
		}
		kb.close();
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		long n = kb.nextLong();
		long a = kb.nextLong();
		long b = kb.nextLong();
		long count = n / (a + b);
		if (a == 0)
			System.out.println(0);
		else if (0 < a && a <= n) {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} else {
			System.out.println(n);
		}
		kb.close();
	} main {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		long n = kb.nextLong();
		long a = kb.nextLong();
		long b = kb.nextLong();
		long count = n / (a + b);
		if (a == 0)
			System.out.println(0);
		else if (0 < a && a <= n) {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} else {
			System.out.println(n);
		}
		kb.close();
	} Scanner kb = new Scanner(System.in); kb new Scanner(System.in) long n = kb.nextLong(); n kb.nextLong() kb.nextLong kb long a = kb.nextLong(); a kb.nextLong() kb.nextLong kb long b = kb.nextLong(); b kb.nextLong() kb.nextLong kb long count = n / (a + b); count n / (a + b) n (a + b) a b if (a == 0)
			System.out.println(0);
		else if (0 < a && a <= n) {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} else {
			System.out.println(n);
		} a == 0 a 0 System.out.println(0) System.out.println System.out System System.out 0 if (0 < a && a <= n) {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} else {
			System.out.println(n);
		} 0 < a && a <= n 0 < a 0 a a <= n a n {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			} a + b >= n a + b a b n System.out.println(a) System.out.println System.out System System.out a {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			} if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a); n - count * (a + b) >= a && n - count * (a + b) != 0 n - count * (a + b) >= a n - count * (a + b) n count * (a + b) count (a + b) a b a n - count * (a + b) != 0 n - count * (a + b) n count * (a + b) count (a + b) a b 0 System.out.println(count * a + a) System.out.println System.out System System.out count * a + a count * a count a a if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a); n - count * (a + b) < a && n - count * (a + b) != 0 n - count * (a + b) < a n - count * (a + b) n count * (a + b) count (a + b) a b a n - count * (a + b) != 0 n - count * (a + b) n count * (a + b) count (a + b) a b 0 System.out.println(count * a + n - count*(a + b)) System.out.println System.out System System.out count * a + n - count*(a + b) count * a + n count * a count a n count*(a + b) count (a + b) a b if (n - count * (a + b) == 0)
					System.out.println(count * a); n - count * (a + b) == 0 n - count * (a + b) n count * (a + b) count (a + b) a b 0 System.out.println(count * a) System.out.println System.out System System.out count * a count a {
			System.out.println(n);
		} System.out.println(n) System.out.println System.out System System.out n kb.close() kb.close kb String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		long n = kb.nextLong();
		long a = kb.nextLong();
		long b = kb.nextLong();
		long count = n / (a + b);
		if (a == 0)
			System.out.println(0);
		else if (0 < a && a <= n) {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} else {
			System.out.println(n);
		}
		kb.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		long n = kb.nextLong();
		long a = kb.nextLong();
		long b = kb.nextLong();
		long count = n / (a + b);
		if (a == 0)
			System.out.println(0);
		else if (0 < a && a <= n) {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} else {
			System.out.println(n);
		}
		kb.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		long n = kb.nextLong();
		long a = kb.nextLong();
		long b = kb.nextLong();
		long count = n / (a + b);
		if (a == 0)
			System.out.println(0);
		else if (0 < a && a <= n) {
			if (a + b >= n)
				System.out.println(a);
			else {
				if (n - count * (a + b) >= a && n - count * (a + b) != 0)
					System.out.println(count * a + a);
				else if (n - count * (a + b) < a && n - count * (a + b) != 0)
					System.out.println(count * a + n - count*(a + b));
				else if (n - count * (a + b) == 0)
					System.out.println(count * a);
			}
		} else {
			System.out.println(n);
		}
		kb.close();
	}

}
