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 tmp = (N / (A + B));
		long rem = N - tmp * (A + B);
		long ans = tmp * A + Math.min(A, rem);
		System.out.println(ans);
	}
} 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 tmp = (N / (A + B));
		long rem = N - tmp * (A + B);
		long ans = tmp * A + Math.min(A, rem);
		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 tmp = (N / (A + B));
		long rem = N - tmp * (A + B);
		long ans = tmp * A + Math.min(A, rem);
		System.out.println(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		long A = scan.nextLong();
		long B = scan.nextLong();
		long tmp = (N / (A + B));
		long rem = N - tmp * (A + B);
		long ans = tmp * A + Math.min(A, rem);
		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 tmp = (N / (A + B)); tmp (N / (A + B)) N (A + B) A B long rem = N - tmp * (A + B); rem N - tmp * (A + B) N tmp * (A + B) tmp (A + B) A B long ans = tmp * A + Math.min(A, rem); ans tmp * A + Math.min(A, rem) tmp * A tmp A Math.min(A, rem) Math.min Math A rem 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 tmp = (N / (A + B));
		long rem = N - tmp * (A + B);
		long ans = tmp * A + Math.min(A, rem);
		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 tmp = (N / (A + B));
		long rem = N - tmp * (A + B);
		long ans = tmp * A + Math.min(A, rem);
		System.out.println(ans);
	}
} 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 tmp = (N / (A + B));
		long rem = N - tmp * (A + B);
		long ans = tmp * A + Math.min(A, rem);
		System.out.println(ans);
	}
}
