import java.io.*;
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();
		
		long count = n / (a + b);
		long rem = n - count * (a + b);
		
		System.out.println(count * a + Math.min(rem, a));
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();
		
		long count = n / (a + b);
		long rem = n - count * (a + b);
		
		System.out.println(count * a + Math.min(rem, a));
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();
		
		long count = n / (a + b);
		long rem = n - count * (a + b);
		
		System.out.println(count * a + Math.min(rem, a));
	} main {
		Scanner scan = new Scanner(System.in);
		
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();
		
		long count = n / (a + b);
		long rem = n - count * (a + b);
		
		System.out.println(count * a + Math.min(rem, a));
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long n = scan.nextLong(); n scan.nextLong() scan.nextLong scan long a = scan.nextLong(); a scan.nextLong() scan.nextLong scan long b = scan.nextLong(); b scan.nextLong() scan.nextLong scan long count = n / (a + b); count n / (a + b) n (a + b) a b long rem = n - count * (a + b); rem n - count * (a + b) n count * (a + b) count (a + b) a b System.out.println(count * a + Math.min(rem, a)) System.out.println System.out System System.out count * a + Math.min(rem, a) count * a count a Math.min(rem, a) Math.min Math rem a String[] args args public class Main {
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();
		
		long count = n / (a + b);
		long rem = n - count * (a + b);
		
		System.out.println(count * a + Math.min(rem, a));
	}
} public class Main {
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();
		
		long count = n / (a + b);
		long rem = n - count * (a + b);
		
		System.out.println(count * a + Math.min(rem, a));
	}
} Main
import java.io.*;
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();
		
		long count = n / (a + b);
		long rem = n - count * (a + b);
		
		System.out.println(count * a + Math.min(rem, a));
	}
}