import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	static int[] S ;
	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		String[] Ws = W.split(" ");
		long[] A = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			A[i] = Long.parseLong(Ws[i]);
		}
		long ans = 0;
		long sum = A[1]+A[2];
		long div = A[0] / sum;
		long mod = A[0] % sum;
		ans = div * A[1] + Math.min(mod, A[1]);

		System.out.println(ans);
	}


} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	static int[] S ;
	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		String[] Ws = W.split(" ");
		long[] A = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			A[i] = Long.parseLong(Ws[i]);
		}
		long ans = 0;
		long sum = A[1]+A[2];
		long div = A[0] / sum;
		long mod = A[0] % sum;
		ans = div * A[1] + Math.min(mod, A[1]);

		System.out.println(ans);
	}


} Main static int[] S ; S public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		String[] Ws = W.split(" ");
		long[] A = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			A[i] = Long.parseLong(Ws[i]);
		}
		long ans = 0;
		long sum = A[1]+A[2];
		long div = A[0] / sum;
		long mod = A[0] % sum;
		ans = div * A[1] + Math.min(mod, A[1]);

		System.out.println(ans);
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		String[] Ws = W.split(" ");
		long[] A = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			A[i] = Long.parseLong(Ws[i]);
		}
		long ans = 0;
		long sum = A[1]+A[2];
		long div = A[0] / sum;
		long mod = A[0] % sum;
		ans = div * A[1] + Math.min(mod, A[1]);

		System.out.println(ans);
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String W = in.readLine(); W in.readLine() in.readLine in String[] Ws = W.split(" "); Ws W.split(" ") W.split W " " long[] A = new long[Ws.length]; A new long[Ws.length] Ws.length Ws Ws.length for (int i = 0; i < Ws.length; i++) {
			A[i] = Long.parseLong(Ws[i]);
		} int i = 0; int i = 0; i 0 i < Ws.length i Ws.length Ws Ws.length i++ i++ i {
			A[i] = Long.parseLong(Ws[i]);
		} {
			A[i] = Long.parseLong(Ws[i]);
		} A[i] = Long.parseLong(Ws[i]) A[i] A i Long.parseLong(Ws[i]) Long.parseLong Long Ws[i] Ws i long ans = 0; ans 0 long sum = A[1]+A[2]; sum A[1]+A[2] A[1] A 1 A[2] A 2 long div = A[0] / sum; div A[0] / sum A[0] A 0 sum long mod = A[0] % sum; mod A[0] % sum A[0] A 0 sum ans = div * A[1] + Math.min(mod, A[1]) ans div * A[1] + Math.min(mod, A[1]) div * A[1] div A[1] A 1 Math.min(mod, A[1]) Math.min Math mod A[1] A 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	static int[] S ;
	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		String[] Ws = W.split(" ");
		long[] A = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			A[i] = Long.parseLong(Ws[i]);
		}
		long ans = 0;
		long sum = A[1]+A[2];
		long div = A[0] / sum;
		long mod = A[0] % sum;
		ans = div * A[1] + Math.min(mod, A[1]);

		System.out.println(ans);
	}


} public class Main {

	static int[] S ;
	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		String[] Ws = W.split(" ");
		long[] A = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			A[i] = Long.parseLong(Ws[i]);
		}
		long ans = 0;
		long sum = A[1]+A[2];
		long div = A[0] / sum;
		long mod = A[0] % sum;
		ans = div * A[1] + Math.min(mod, A[1]);

		System.out.println(ans);
	}


} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	static int[] S ;
	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		String[] Ws = W.split(" ");
		long[] A = new long[Ws.length];
		for (int i = 0; i < Ws.length; i++) {
			A[i] = Long.parseLong(Ws[i]);
		}
		long ans = 0;
		long sum = A[1]+A[2];
		long div = A[0] / sum;
		long mod = A[0] % sum;
		ans = div * A[1] + Math.min(mod, A[1]);

		System.out.println(ans);
	}


}
