import java.util.Scanner;

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 ans = (n / (a + b)) * a;
		long mod = n % (a + b);
		ans += Math.min(mod, a);

		System.out.println(ans);
	}
} import java.util.Scanner; Scanner 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 ans = (n / (a + b)) * a;
		long mod = n % (a + b);
		ans += Math.min(mod, a);

		System.out.println(ans);
	}
} 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 ans = (n / (a + b)) * a;
		long mod = n % (a + b);
		ans += Math.min(mod, a);

		System.out.println(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long ans = (n / (a + b)) * a;
		long mod = n % (a + b);
		ans += Math.min(mod, a);

		System.out.println(ans);
	} 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 ans = (n / (a + b)) * a; ans (n / (a + b)) * a (n / (a + b)) n (a + b) a b a long mod = n % (a + b); mod n % (a + b) n (a + b) a b ans += Math.min(mod, a) ans Math.min(mod, a) Math.min Math mod a System.out.println(ans) System.out.println System.out System System.out ans 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 ans = (n / (a + b)) * a;
		long mod = n % (a + b);
		ans += Math.min(mod, a);

		System.out.println(ans);
	}
} 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 ans = (n / (a + b)) * a;
		long mod = n % (a + b);
		ans += Math.min(mod, a);

		System.out.println(ans);
	}
} Main
import java.util.Scanner;

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 ans = (n / (a + b)) * a;
		long mod = n % (a + b);
		ans += Math.min(mod, a);

		System.out.println(ans);
	}
}
