import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

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

		//B+RがNよりも小さい場合
		if (target <= sum) {
			if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			}
		}

		//B+RがNよりも大きい場合
		long count = target / sum;
		long temp = target - (count * sum);

		if (b <= temp) {
			System.out.println(count * b + b);
		} else {
			System.out.println(count * b + temp);
		}

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

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

		//B+RがNよりも小さい場合
		if (target <= sum) {
			if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			}
		}

		//B+RがNよりも大きい場合
		long count = target / sum;
		long temp = target - (count * sum);

		if (b <= temp) {
			System.out.println(count * b + b);
		} else {
			System.out.println(count * b + temp);
		}

	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

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

		//B+RがNよりも小さい場合
		if (target <= sum) {
			if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			}
		}

		//B+RがNよりも大きい場合
		long count = target / sum;
		long temp = target - (count * sum);

		if (b <= temp) {
			System.out.println(count * b + b);
		} else {
			System.out.println(count * b + temp);
		}

	} main {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

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

		//B+RがNよりも小さい場合
		if (target <= sum) {
			if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			}
		}

		//B+RがNよりも大きい場合
		long count = target / sum;
		long temp = target - (count * sum);

		if (b <= temp) {
			System.out.println(count * b + b);
		} else {
			System.out.println(count * b + temp);
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long target = sc.nextLong(); target sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long r = sc.nextLong(); r sc.nextLong() sc.nextLong sc long sum = r + b; sum r + b r b if (b == 0 || target == 0) {
			System.out.println(0);
			return;
		} b == 0 || target == 0 b == 0 b 0 target == 0 target 0 {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; if (target <= sum) {
			if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			}
		} target <= sum target sum {
			if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			}
		} if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			} b <= target b target {
				System.out.println(b);
				return;
			} System.out.println(b) System.out.println System.out System System.out b return; {
				System.out.println(target);
				return;
			} System.out.println(target) System.out.println System.out System System.out target return; long count = target / sum; count target / sum target sum long temp = target - (count * sum); temp target - (count * sum) target (count * sum) count sum if (b <= temp) {
			System.out.println(count * b + b);
		} else {
			System.out.println(count * b + temp);
		} b <= temp b temp {
			System.out.println(count * b + b);
		} System.out.println(count * b + b) System.out.println System.out System System.out count * b + b count * b count b b {
			System.out.println(count * b + temp);
		} System.out.println(count * b + temp) System.out.println System.out System System.out count * b + temp count * b count b temp String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

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

		//B+RがNよりも小さい場合
		if (target <= sum) {
			if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			}
		}

		//B+RがNよりも大きい場合
		long count = target / sum;
		long temp = target - (count * sum);

		if (b <= temp) {
			System.out.println(count * b + b);
		} else {
			System.out.println(count * b + temp);
		}

	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

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

		//B+RがNよりも小さい場合
		if (target <= sum) {
			if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			}
		}

		//B+RがNよりも大きい場合
		long count = target / sum;
		long temp = target - (count * sum);

		if (b <= temp) {
			System.out.println(count * b + b);
		} else {
			System.out.println(count * b + temp);
		}

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

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

		//B+RがNよりも小さい場合
		if (target <= sum) {
			if(b <= target) {
				System.out.println(b);
				return;
			}else{
				System.out.println(target);
				return;
			}
		}

		//B+RがNよりも大きい場合
		long count = target / sum;
		long temp = target - (count * sum);

		if (b <= temp) {
			System.out.println(count * b + b);
		} else {
			System.out.println(count * b + temp);
		}

	}
}
