

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long AB = A + B;

		long c = 0;

		if (N % AB > A) {
			c = A;
		} else {
			c = N % AB;
		}

		System.out.println(A * (N / AB) + c);

	}

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

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long AB = A + B;

		long c = 0;

		if (N % AB > A) {
			c = A;
		} else {
			c = N % AB;
		}

		System.out.println(A * (N / AB) + c);

	}

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

		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long AB = A + B;

		long c = 0;

		if (N % AB > A) {
			c = A;
		} else {
			c = N % AB;
		}

		System.out.println(A * (N / AB) + c);

	} main {

		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long AB = A + B;

		long c = 0;

		if (N % AB > A) {
			c = A;
		} else {
			c = N % AB;
		}

		System.out.println(A * (N / AB) + c);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long N = scan.nextLong(); N scan.nextLong() scan.nextLong scan long A = scan.nextLong(); A scan.nextLong() scan.nextLong scan long B = scan.nextLong(); B scan.nextLong() scan.nextLong scan long AB = A + B; AB A + B A B long c = 0; c 0 if (N % AB > A) {
			c = A;
		} else {
			c = N % AB;
		} N % AB > A N % AB N AB A {
			c = A;
		} c = A c A {
			c = N % AB;
		} c = N % AB c N % AB N AB System.out.println(A * (N / AB) + c) System.out.println System.out System System.out A * (N / AB) + c A * (N / AB) A (N / AB) N AB c String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long AB = A + B;

		long c = 0;

		if (N % AB > A) {
			c = A;
		} else {
			c = N % AB;
		}

		System.out.println(A * (N / AB) + c);

	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long AB = A + B;

		long c = 0;

		if (N % AB > A) {
			c = A;
		} else {
			c = N % AB;
		}

		System.out.println(A * (N / AB) + c);

	}

} Main


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long AB = A + B;

		long c = 0;

		if (N % AB > A) {
			c = A;
		} else {
			c = N % AB;
		}

		System.out.println(A * (N / AB) + c);

	}

}
