import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();
		// aがnより大きいパタン
		if (a > n) {
			System.out.println(n);
		}
		// a+bがnより以上のパタン
		else if ((a + b) >= n) {
			System.out.println(a);
		}
		// a+bがn以下のパタン
		else {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();
		// aがnより大きいパタン
		if (a > n) {
			System.out.println(n);
		}
		// a+bがnより以上のパタン
		else if ((a + b) >= n) {
			System.out.println(a);
		}
		// a+bがn以下のパタン
		else {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();
		// aがnより大きいパタン
		if (a > n) {
			System.out.println(n);
		}
		// a+bがnより以上のパタン
		else if ((a + b) >= n) {
			System.out.println(a);
		}
		// a+bがn以下のパタン
		else {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();
		// aがnより大きいパタン
		if (a > n) {
			System.out.println(n);
		}
		// a+bがnより以上のパタン
		else if ((a + b) >= n) {
			System.out.println(a);
		}
		// a+bがn以下のパタン
		else {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc sc.close() sc.close sc if (a > n) {
			System.out.println(n);
		}
		// a+bがnより以上のパタン
		else if ((a + b) >= n) {
			System.out.println(a);
		}
		// a+bがn以下のパタン
		else {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		} a > n a n {
			System.out.println(n);
		} System.out.println(n) System.out.println System.out System System.out n if ((a + b) >= n) {
			System.out.println(a);
		}
		// a+bがn以下のパタン
		else {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		} (a + b) >= n (a + b) a b n {
			System.out.println(a);
		} System.out.println(a) System.out.println System.out System System.out a {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		} long ab = a + b; ab a + b a b long count = n / ab; count n / ab n ab long remainder = n % ab; remainder n % ab n ab long ans = a * count; ans a * count a count if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			} remainder >= a remainder a {
				ans = ans + a;
			} ans = ans + a ans ans + a ans a {
				ans = ans + remainder;
			} ans = ans + remainder ans ans + remainder ans remainder System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();
		// aがnより大きいパタン
		if (a > n) {
			System.out.println(n);
		}
		// a+bがnより以上のパタン
		else if ((a + b) >= n) {
			System.out.println(a);
		}
		// a+bがn以下のパタン
		else {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();
		// aがnより大きいパタン
		if (a > n) {
			System.out.println(n);
		}
		// a+bがnより以上のパタン
		else if ((a + b) >= n) {
			System.out.println(a);
		}
		// a+bがn以下のパタン
		else {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();
		// aがnより大きいパタン
		if (a > n) {
			System.out.println(n);
		}
		// a+bがnより以上のパタン
		else if ((a + b) >= n) {
			System.out.println(a);
		}
		// a+bがn以下のパタン
		else {
			long ab = a + b;
			long count = n / ab;
			long remainder = n % ab;
			long ans = a * count;
			if (remainder >= a) {
				ans = ans + a;
			} else {
				ans = ans + remainder;
			}
			System.out.println(ans);
		}
	}
}
