import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		if(n - cnt * c <= a) {
			System.out.println(cnt * a + (n - cnt * c));
		}else {
			System.out.println(cnt * a + a);
		}
		
		
	}

} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		if(n - cnt * c <= a) {
			System.out.println(cnt * a + (n - cnt * c));
		}else {
			System.out.println(cnt * a + a);
		}
		
		
	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		if(n - cnt * c <= a) {
			System.out.println(cnt * a + (n - cnt * c));
		}else {
			System.out.println(cnt * a + a);
		}
		
		
	} main {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		if(n - cnt * c <= a) {
			System.out.println(cnt * a + (n - cnt * c));
		}else {
			System.out.println(cnt * a + a);
		}
		
		
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) long n = stdIn.nextLong(); n stdIn.nextLong() stdIn.nextLong stdIn long a = stdIn.nextLong(); a stdIn.nextLong() stdIn.nextLong stdIn long b = stdIn.nextLong(); b stdIn.nextLong() stdIn.nextLong stdIn long c = a + b; c a + b a b long cnt = n / c; cnt n / c n c if(n - cnt * c <= a) {
			System.out.println(cnt * a + (n - cnt * c));
		}else {
			System.out.println(cnt * a + a);
		} n - cnt * c <= a n - cnt * c n cnt * c cnt c a {
			System.out.println(cnt * a + (n - cnt * c));
		} System.out.println(cnt * a + (n - cnt * c)) System.out.println System.out System System.out cnt * a + (n - cnt * c) cnt * a cnt a (n - cnt * c) n cnt * c cnt c {
			System.out.println(cnt * a + a);
		} System.out.println(cnt * a + a) System.out.println System.out System System.out cnt * a + a cnt * a cnt a a String[] args args public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		if(n - cnt * c <= a) {
			System.out.println(cnt * a + (n - cnt * c));
		}else {
			System.out.println(cnt * a + a);
		}
		
		
	}

} public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		if(n - cnt * c <= a) {
			System.out.println(cnt * a + (n - cnt * c));
		}else {
			System.out.println(cnt * a + a);
		}
		
		
	}

} Main
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		if(n - cnt * c <= a) {
			System.out.println(cnt * a + (n - cnt * c));
		}else {
			System.out.println(cnt * a + a);
		}
		
		
	}

}
