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 ans = 0;
		long sum = 0;
		long c = 0;
		c = N / (A + B);
		sum = c * A;
		ans = N % (A + B);

		if(ans > A){
			sum = sum + A;
		}
		else{
			sum = sum + ans;
		}
		System.out.println(sum);
		stdIn.close();
	}
} 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 ans = 0;
		long sum = 0;
		long c = 0;
		c = N / (A + B);
		sum = c * A;
		ans = N % (A + B);

		if(ans > A){
			sum = sum + A;
		}
		else{
			sum = sum + ans;
		}
		System.out.println(sum);
		stdIn.close();
	}
} 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 ans = 0;
		long sum = 0;
		long c = 0;
		c = N / (A + B);
		sum = c * A;
		ans = N % (A + B);

		if(ans > A){
			sum = sum + A;
		}
		else{
			sum = sum + ans;
		}
		System.out.println(sum);
		stdIn.close();
	} main {
		Scanner stdIn = new Scanner(System.in);
		long N = stdIn.nextLong();
		long A = stdIn.nextLong();
		long B = stdIn.nextLong();
		long ans = 0;
		long sum = 0;
		long c = 0;
		c = N / (A + B);
		sum = c * A;
		ans = N % (A + B);

		if(ans > A){
			sum = sum + A;
		}
		else{
			sum = sum + ans;
		}
		System.out.println(sum);
		stdIn.close();
	} 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 ans = 0; ans 0 long sum = 0; sum 0 long c = 0; c 0 c = N / (A + B) c N / (A + B) N (A + B) A B sum = c * A sum c * A c A ans = N % (A + B) ans N % (A + B) N (A + B) A B if(ans > A){
			sum = sum + A;
		}
		else{
			sum = sum + ans;
		} ans > A ans A {
			sum = sum + A;
		} sum = sum + A sum sum + A sum A {
			sum = sum + ans;
		} sum = sum + ans sum sum + ans sum ans System.out.println(sum) System.out.println System.out System System.out sum stdIn.close() stdIn.close stdIn 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 ans = 0;
		long sum = 0;
		long c = 0;
		c = N / (A + B);
		sum = c * A;
		ans = N % (A + B);

		if(ans > A){
			sum = sum + A;
		}
		else{
			sum = sum + ans;
		}
		System.out.println(sum);
		stdIn.close();
	}
} 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 ans = 0;
		long sum = 0;
		long c = 0;
		c = N / (A + B);
		sum = c * A;
		ans = N % (A + B);

		if(ans > A){
			sum = sum + A;
		}
		else{
			sum = sum + ans;
		}
		System.out.println(sum);
		stdIn.close();
	}
} 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 ans = 0;
		long sum = 0;
		long c = 0;
		c = N / (A + B);
		sum = c * A;
		ans = N % (A + B);

		if(ans > A){
			sum = sum + A;
		}
		else{
			sum = sum + ans;
		}
		System.out.println(sum);
		stdIn.close();
	}
}