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 a1 = n/(a+b)*a;
			long a2;
			long c = n%(a+b);
			if(c<=a) {
				a2 =c;	
			}else {
				a2 =a;
			}
			
			if(a==0) {
				System.out.println(0);
			}else {
				System.out.println(a1+a2);
			}
			
			
		}

	} 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 a1 = n/(a+b)*a;
			long a2;
			long c = n%(a+b);
			if(c<=a) {
				a2 =c;	
			}else {
				a2 =a;
			}
			
			if(a==0) {
				System.out.println(0);
			}else {
				System.out.println(a1+a2);
			}
			
			
		}

	} 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 a1 = n/(a+b)*a;
			long a2;
			long c = n%(a+b);
			if(c<=a) {
				a2 =c;	
			}else {
				a2 =a;
			}
			
			if(a==0) {
				System.out.println(0);
			}else {
				System.out.println(a1+a2);
			}
			
			
		} main {

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

	} 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 a1 = n/(a+b)*a;
			long a2;
			long c = n%(a+b);
			if(c<=a) {
				a2 =c;	
			}else {
				a2 =a;
			}
			
			if(a==0) {
				System.out.println(0);
			}else {
				System.out.println(a1+a2);
			}
			
			
		}

	} 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 a1 = n/(a+b)*a;
			long a2;
			long c = n%(a+b);
			if(c<=a) {
				a2 =c;	
			}else {
				a2 =a;
			}
			
			if(a==0) {
				System.out.println(0);
			}else {
				System.out.println(a1+a2);
			}
			
			
		}

	}