import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println(n % (a + b) <= a ? n / (a + b) * a + n % (a + b) : n / (a + b) * a + a);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println(n % (a + b) <= a ? n / (a + b) * a + n % (a + b) : n / (a + b) * a + a);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println(n % (a + b) <= a ? n / (a + b) * a + n % (a + b) : n / (a + b) * a + a);
	} main {
		Scanner sc = new Scanner(System.in);
		
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println(n % (a + b) <= a ? n / (a + b) * a + n % (a + b) : n / (a + b) * a + a);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = Long.parseLong(sc.next()); n Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long a = Long.parseLong(sc.next()); a Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long b = Long.parseLong(sc.next()); b Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc System.out.println(n % (a + b) <= a ? n / (a + b) * a + n % (a + b) : n / (a + b) * a + a) System.out.println System.out System System.out n % (a + b) <= a ? n / (a + b) * a + n % (a + b) : n / (a + b) * a + a n % (a + b) <= a n % (a + b) n (a + b) a b a n / (a + b) * a + n % (a + b) n / (a + b) * a n / (a + b) n (a + b) a b a n % (a + b) n (a + b) a b n / (a + b) * a + a n / (a + b) * a n / (a + b) n (a + b) a b a a String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println(n % (a + b) <= a ? n / (a + b) * a + n % (a + b) : n / (a + b) * a + a);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println(n % (a + b) <= a ? n / (a + b) * a + n % (a + b) : n / (a + b) * a + a);
	}
} Main
import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println(n % (a + b) <= a ? n / (a + b) * a + n % (a + b) : n / (a + b) * a + a);
	}
}
