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();

		long ans = 0;
		long total = A + B;

		if (A == 0) {
			System.out.println(0);
		} else {
			ans = ((N / total) * A) + Math.min(N % total, A);
			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();

		long ans = 0;
		long total = A + B;

		if (A == 0) {
			System.out.println(0);
		} else {
			ans = ((N / total) * A) + Math.min(N % total, A);
			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();

		long ans = 0;
		long total = A + B;

		if (A == 0) {
			System.out.println(0);
		} else {
			ans = ((N / total) * A) + Math.min(N % total, A);
			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();

		long ans = 0;
		long total = A + B;

		if (A == 0) {
			System.out.println(0);
		} else {
			ans = ((N / total) * A) + Math.min(N % total, A);
			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 long ans = 0; ans 0 long total = A + B; total A + B A B if (A == 0) {
			System.out.println(0);
		} else {
			ans = ((N / total) * A) + Math.min(N % total, A);
			System.out.println(ans);
		} A == 0 A 0 {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 {
			ans = ((N / total) * A) + Math.min(N % total, A);
			System.out.println(ans);
		} ans = ((N / total) * A) + Math.min(N % total, A) ans ((N / total) * A) + Math.min(N % total, A) ((N / total) * A) (N / total) N total A Math.min(N % total, A) Math.min Math N % total N total A 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();

		long ans = 0;
		long total = A + B;

		if (A == 0) {
			System.out.println(0);
		} else {
			ans = ((N / total) * A) + Math.min(N % total, A);
			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();

		long ans = 0;
		long total = A + B;

		if (A == 0) {
			System.out.println(0);
		} else {
			ans = ((N / total) * A) + Math.min(N % total, A);
			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();

		long ans = 0;
		long total = A + B;

		if (A == 0) {
			System.out.println(0);
		} else {
			ans = ((N / total) * A) + Math.min(N % total, A);
			System.out.println(ans);
		}
	}

}
