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 ans = (N / (A+B)) * A;
		long rem =  N % (A + B) > A ? A: N%(A + B);

		System.out.println(ans + rem);

	}
} 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 ans = (N / (A+B)) * A;
		long rem =  N % (A + B) > A ? A: N%(A + B);

		System.out.println(ans + rem);

	}
} 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 ans = (N / (A+B)) * A;
		long rem =  N % (A + B) > A ? A: N%(A + B);

		System.out.println(ans + rem);

	} main {

		Scanner scan = new Scanner(System.in);

		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();

		long ans = (N / (A+B)) * A;
		long rem =  N % (A + B) > A ? A: N%(A + B);

		System.out.println(ans + rem);

	} 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 ans = (N / (A+B)) * A; ans (N / (A+B)) * A (N / (A+B)) N (A+B) A B A long rem =  N % (A + B) > A ? A: N%(A + B); rem N % (A + B) > A ? A: N%(A + B) N % (A + B) > A N % (A + B) N (A + B) A B A A N%(A + B) N (A + B) A B System.out.println(ans + rem) System.out.println System.out System System.out ans + rem ans rem 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 ans = (N / (A+B)) * A;
		long rem =  N % (A + B) > A ? A: N%(A + B);

		System.out.println(ans + rem);

	}
} 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 ans = (N / (A+B)) * A;
		long rem =  N % (A + B) > A ? A: N%(A + B);

		System.out.println(ans + rem);

	}
} 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 ans = (N / (A+B)) * A;
		long rem =  N % (A + B) > A ? A: N%(A + B);

		System.out.println(ans + rem);

	}
}
