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();
		long res = n/(a+b);
		long mod = n%(a+b);
		if(mod>=a)
			mod = a;
		
		System.out.println(res*a+mod);
}

} 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();
		long res = n/(a+b);
		long mod = n%(a+b);
		if(mod>=a)
			mod = a;
		
		System.out.println(res*a+mod);
}

} 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();
		long res = n/(a+b);
		long mod = n%(a+b);
		if(mod>=a)
			mod = a;
		
		System.out.println(res*a+mod);
} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		long res = n/(a+b);
		long mod = n%(a+b);
		if(mod>=a)
			mod = a;
		
		System.out.println(res*a+mod);
} 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 long res = n/(a+b); res n/(a+b) n (a+b) a b long mod = n%(a+b); mod n%(a+b) n (a+b) a b if(mod>=a)
			mod = a; mod>=a mod a mod = a mod a System.out.println(res*a+mod) System.out.println System.out System System.out res*a+mod res*a res a mod 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();
		long res = n/(a+b);
		long mod = n%(a+b);
		if(mod>=a)
			mod = a;
		
		System.out.println(res*a+mod);
}

} 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();
		long res = n/(a+b);
		long mod = n%(a+b);
		if(mod>=a)
			mod = a;
		
		System.out.println(res*a+mod);
}

} 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();
		long res = n/(a+b);
		long mod = n%(a+b);
		if(mod>=a)
			mod = a;
		
		System.out.println(res*a+mod);
}

}
