

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

public class Main {
	public static void main(String[] args) throws IOException{
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		String[] line = br.readLine().split(" ");
		long n = Long.parseLong(line[0]);
		long a = Long.parseLong(line[1]);
		long b = Long.parseLong(line[2]);
		br.close();
		long blue = 0;
		if(a == 0) {
			blue = 0;
		}else {
			long mod = n%(a+b);
			long div = n/(a+b);
			if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			}
		}
		System.out.println(blue);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException{
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		String[] line = br.readLine().split(" ");
		long n = Long.parseLong(line[0]);
		long a = Long.parseLong(line[1]);
		long b = Long.parseLong(line[2]);
		br.close();
		long blue = 0;
		if(a == 0) {
			blue = 0;
		}else {
			long mod = n%(a+b);
			long div = n/(a+b);
			if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			}
		}
		System.out.println(blue);
	}
} Main public static void main(String[] args) throws IOException{
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		String[] line = br.readLine().split(" ");
		long n = Long.parseLong(line[0]);
		long a = Long.parseLong(line[1]);
		long b = Long.parseLong(line[2]);
		br.close();
		long blue = 0;
		if(a == 0) {
			blue = 0;
		}else {
			long mod = n%(a+b);
			long div = n/(a+b);
			if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			}
		}
		System.out.println(blue);
	} main {
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		String[] line = br.readLine().split(" ");
		long n = Long.parseLong(line[0]);
		long a = Long.parseLong(line[1]);
		long b = Long.parseLong(line[2]);
		br.close();
		long blue = 0;
		if(a == 0) {
			blue = 0;
		}else {
			long mod = n%(a+b);
			long div = n/(a+b);
			if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			}
		}
		System.out.println(blue);
	} InputStreamReader in = new InputStreamReader(System.in); in new InputStreamReader(System.in) BufferedReader br = new BufferedReader(in); br new BufferedReader(in) String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long n = Long.parseLong(line[0]); n Long.parseLong(line[0]) Long.parseLong Long line[0] line 0 long a = Long.parseLong(line[1]); a Long.parseLong(line[1]) Long.parseLong Long line[1] line 1 long b = Long.parseLong(line[2]); b Long.parseLong(line[2]) Long.parseLong Long line[2] line 2 br.close() br.close br long blue = 0; blue 0 if(a == 0) {
			blue = 0;
		}else {
			long mod = n%(a+b);
			long div = n/(a+b);
			if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			}
		} a == 0 a 0 {
			blue = 0;
		} blue = 0 blue 0 {
			long mod = n%(a+b);
			long div = n/(a+b);
			if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			}
		} long mod = n%(a+b); mod n%(a+b) n (a+b) a b long div = n/(a+b); div n/(a+b) n (a+b) a b if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			} mod==0 || mod<=a mod==0 mod 0 mod<=a mod a {
				blue = a * div + mod;
			} blue = a * div + mod blue a * div + mod a * div a div mod {
				blue = a * div + a;
			} blue = a * div + a blue a * div + a a * div a div a System.out.println(blue) System.out.println System.out System System.out blue String[] args args public class Main {
	public static void main(String[] args) throws IOException{
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		String[] line = br.readLine().split(" ");
		long n = Long.parseLong(line[0]);
		long a = Long.parseLong(line[1]);
		long b = Long.parseLong(line[2]);
		br.close();
		long blue = 0;
		if(a == 0) {
			blue = 0;
		}else {
			long mod = n%(a+b);
			long div = n/(a+b);
			if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			}
		}
		System.out.println(blue);
	}
} public class Main {
	public static void main(String[] args) throws IOException{
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		String[] line = br.readLine().split(" ");
		long n = Long.parseLong(line[0]);
		long a = Long.parseLong(line[1]);
		long b = Long.parseLong(line[2]);
		br.close();
		long blue = 0;
		if(a == 0) {
			blue = 0;
		}else {
			long mod = n%(a+b);
			long div = n/(a+b);
			if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			}
		}
		System.out.println(blue);
	}
} Main


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

public class Main {
	public static void main(String[] args) throws IOException{
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
		String[] line = br.readLine().split(" ");
		long n = Long.parseLong(line[0]);
		long a = Long.parseLong(line[1]);
		long b = Long.parseLong(line[2]);
		br.close();
		long blue = 0;
		if(a == 0) {
			blue = 0;
		}else {
			long mod = n%(a+b);
			long div = n/(a+b);
			if(mod==0 || mod<=a) {
				blue = a * div + mod;
			}else {
				blue = a * div + a;
			}
		}
		System.out.println(blue);
	}
}
