//package atcoder;
 
import java.util.*;
import java.math.BigDecimal;
 
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 b = N/(A+B)*A;
		long nokori = N%(A+B);
		long b2=0;
		if(nokori>=A) {
			b2 = A;
		}
		if(nokori<A) {
			b2 = nokori;
		}
		System.out.println(b+b2);
	}
} import java.util.*; util.* java import java.math.BigDecimal; BigDecimal java.math 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 b = N/(A+B)*A;
		long nokori = N%(A+B);
		long b2=0;
		if(nokori>=A) {
			b2 = A;
		}
		if(nokori<A) {
			b2 = nokori;
		}
		System.out.println(b+b2);
	}
} 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 b = N/(A+B)*A;
		long nokori = N%(A+B);
		long b2=0;
		if(nokori>=A) {
			b2 = A;
		}
		if(nokori<A) {
			b2 = nokori;
		}
		System.out.println(b+b2);
	} main {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long b = N/(A+B)*A;
		long nokori = N%(A+B);
		long b2=0;
		if(nokori>=A) {
			b2 = A;
		}
		if(nokori<A) {
			b2 = nokori;
		}
		System.out.println(b+b2);
	} 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 b = N/(A+B)*A; b N/(A+B)*A N/(A+B) N (A+B) A B A long nokori = N%(A+B); nokori N%(A+B) N (A+B) A B long b2=0; b2 0 if(nokori>=A) {
			b2 = A;
		} nokori>=A nokori A {
			b2 = A;
		} b2 = A b2 A if(nokori<A) {
			b2 = nokori;
		} nokori<A nokori A {
			b2 = nokori;
		} b2 = nokori b2 nokori System.out.println(b+b2) System.out.println System.out System System.out b+b2 b b2 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 b = N/(A+B)*A;
		long nokori = N%(A+B);
		long b2=0;
		if(nokori>=A) {
			b2 = A;
		}
		if(nokori<A) {
			b2 = nokori;
		}
		System.out.println(b+b2);
	}
} 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 b = N/(A+B)*A;
		long nokori = N%(A+B);
		long b2=0;
		if(nokori>=A) {
			b2 = A;
		}
		if(nokori<A) {
			b2 = nokori;
		}
		System.out.println(b+b2);
	}
} Main
//package atcoder;
 
import java.util.*;
import java.math.BigDecimal;
 
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 b = N/(A+B)*A;
		long nokori = N%(A+B);
		long b2=0;
		if(nokori>=A) {
			b2 = A;
		}
		if(nokori<A) {
			b2 = nokori;
		}
		System.out.println(b+b2);
	}
}