import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		long n = Long.parseLong(str[0]);
		long a = Long.parseLong(str[1]);
		long b = Long.parseLong(str[2]);

		long x = n / (a + b);
		long min = Math.min(n % (a + b), a);
		System.out.println(x * a + min);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		long n = Long.parseLong(str[0]);
		long a = Long.parseLong(str[1]);
		long b = Long.parseLong(str[2]);

		long x = n / (a + b);
		long min = Math.min(n % (a + b), a);
		System.out.println(x * a + min);
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		long n = Long.parseLong(str[0]);
		long a = Long.parseLong(str[1]);
		long b = Long.parseLong(str[2]);

		long x = n / (a + b);
		long min = Math.min(n % (a + b), a);
		System.out.println(x * a + min);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		long n = Long.parseLong(str[0]);
		long a = Long.parseLong(str[1]);
		long b = Long.parseLong(str[2]);

		long x = n / (a + b);
		long min = Math.min(n % (a + b), a);
		System.out.println(x * a + min);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long n = Long.parseLong(str[0]); n Long.parseLong(str[0]) Long.parseLong Long str[0] str 0 long a = Long.parseLong(str[1]); a Long.parseLong(str[1]) Long.parseLong Long str[1] str 1 long b = Long.parseLong(str[2]); b Long.parseLong(str[2]) Long.parseLong Long str[2] str 2 long x = n / (a + b); x n / (a + b) n (a + b) a b long min = Math.min(n % (a + b), a); min Math.min(n % (a + b), a) Math.min Math n % (a + b) n (a + b) a b a System.out.println(x * a + min) System.out.println System.out System System.out x * a + min x * a x a min String args[] args public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		long n = Long.parseLong(str[0]);
		long a = Long.parseLong(str[1]);
		long b = Long.parseLong(str[2]);

		long x = n / (a + b);
		long min = Math.min(n % (a + b), a);
		System.out.println(x * a + min);
	}
} public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		long n = Long.parseLong(str[0]);
		long a = Long.parseLong(str[1]);
		long b = Long.parseLong(str[2]);

		long x = n / (a + b);
		long min = Math.min(n % (a + b), a);
		System.out.println(x * a + min);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");
		long n = Long.parseLong(str[0]);
		long a = Long.parseLong(str[1]);
		long b = Long.parseLong(str[2]);

		long x = n / (a + b);
		long min = Math.min(n % (a + b), a);
		System.out.println(x * a + min);
	}
}
