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