import java.util.Scanner;

class Main {
	public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong(),a=sc.nextLong(),b=sc.nextLong();
		System.out.println(n/(a+b)*a+Math.min(n%(a+b),a));
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong(),a=sc.nextLong(),b=sc.nextLong();
		System.out.println(n/(a+b)*a+Math.min(n%(a+b),a));
	}
} Main public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong(),a=sc.nextLong(),b=sc.nextLong();
		System.out.println(n/(a+b)*a+Math.min(n%(a+b),a));
	} main {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong(),a=sc.nextLong(),b=sc.nextLong();
		System.out.println(n/(a+b)*a+Math.min(n%(a+b),a));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n=sc.nextLong() n sc.nextLong() sc.nextLong sc a=sc.nextLong() a sc.nextLong() sc.nextLong sc b=sc.nextLong(); b sc.nextLong() sc.nextLong sc System.out.println(n/(a+b)*a+Math.min(n%(a+b),a)) System.out.println System.out System System.out n/(a+b)*a+Math.min(n%(a+b),a) n/(a+b)*a n/(a+b) n (a+b) a b a Math.min(n%(a+b),a) Math.min Math n%(a+b) n (a+b) a b a String[] $ $
import java.util.Scanner;

class Main {
	public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong(),a=sc.nextLong(),b=sc.nextLong();
		System.out.println(n/(a+b)*a+Math.min(n%(a+b),a));
	}
}