import java.util.*;
import java.lang.*;
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 cc = 0;
		if( N%(A+B)<=A ){
			cc = N%(A+B);
		}else{
			cc = A;
		}
		System.out.println(N/(A+B)*A+cc);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java 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 cc = 0;
		if( N%(A+B)<=A ){
			cc = N%(A+B);
		}else{
			cc = A;
		}
		System.out.println(N/(A+B)*A+cc);
	}
} 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 cc = 0;
		if( N%(A+B)<=A ){
			cc = N%(A+B);
		}else{
			cc = A;
		}
		System.out.println(N/(A+B)*A+cc);
	} main {
		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long cc = 0;
		if( N%(A+B)<=A ){
			cc = N%(A+B);
		}else{
			cc = A;
		}
		System.out.println(N/(A+B)*A+cc);
	} 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 cc = 0; cc 0 if( N%(A+B)<=A ){
			cc = N%(A+B);
		}else{
			cc = A;
		} N%(A+B)<=A N%(A+B) N (A+B) A B A {
			cc = N%(A+B);
		} cc = N%(A+B) cc N%(A+B) N (A+B) A B {
			cc = A;
		} cc = A cc A System.out.println(N/(A+B)*A+cc) System.out.println System.out System System.out N/(A+B)*A+cc N/(A+B)*A N/(A+B) N (A+B) A B A cc 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 cc = 0;
		if( N%(A+B)<=A ){
			cc = N%(A+B);
		}else{
			cc = A;
		}
		System.out.println(N/(A+B)*A+cc);
	}
} 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 cc = 0;
		if( N%(A+B)<=A ){
			cc = N%(A+B);
		}else{
			cc = A;
		}
		System.out.println(N/(A+B)*A+cc);
	}
} Main
import java.util.*;
import java.lang.*;
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 cc = 0;
		if( N%(A+B)<=A ){
			cc = N%(A+B);
		}else{
			cc = A;
		}
		System.out.println(N/(A+B)*A+cc);
	}
}
