import java.util.Scanner;

public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] temp = scanner.nextLine().split(" ");
		long n = Long.parseLong(temp[0]);
		long a = Long.parseLong(temp[1]);
		long b = Long.parseLong(temp[2]);

		double cnt = Math.floor(n / (double)(a + b));
		long ans = (long)cnt * b;


		long diff = n - (long)cnt * (a + b);

		ans += diff > a ? diff - a : 0;

		System.out.println(n - ans);


	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] temp = scanner.nextLine().split(" ");
		long n = Long.parseLong(temp[0]);
		long a = Long.parseLong(temp[1]);
		long b = Long.parseLong(temp[2]);

		double cnt = Math.floor(n / (double)(a + b));
		long ans = (long)cnt * b;


		long diff = n - (long)cnt * (a + b);

		ans += diff > a ? diff - a : 0;

		System.out.println(n - ans);


	}
} Main public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] temp = scanner.nextLine().split(" ");
		long n = Long.parseLong(temp[0]);
		long a = Long.parseLong(temp[1]);
		long b = Long.parseLong(temp[2]);

		double cnt = Math.floor(n / (double)(a + b));
		long ans = (long)cnt * b;


		long diff = n - (long)cnt * (a + b);

		ans += diff > a ? diff - a : 0;

		System.out.println(n - ans);


	} main {

		Scanner scanner = new Scanner(System.in);

		String[] temp = scanner.nextLine().split(" ");
		long n = Long.parseLong(temp[0]);
		long a = Long.parseLong(temp[1]);
		long b = Long.parseLong(temp[2]);

		double cnt = Math.floor(n / (double)(a + b));
		long ans = (long)cnt * b;


		long diff = n - (long)cnt * (a + b);

		ans += diff > a ? diff - a : 0;

		System.out.println(n - ans);


	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] temp = scanner.nextLine().split(" "); temp scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " long n = Long.parseLong(temp[0]); n Long.parseLong(temp[0]) Long.parseLong Long temp[0] temp 0 long a = Long.parseLong(temp[1]); a Long.parseLong(temp[1]) Long.parseLong Long temp[1] temp 1 long b = Long.parseLong(temp[2]); b Long.parseLong(temp[2]) Long.parseLong Long temp[2] temp 2 double cnt = Math.floor(n / (double)(a + b)); cnt Math.floor(n / (double)(a + b)) Math.floor Math n / (double)(a + b) n (double)(a + b) a b long ans = (long)cnt * b; ans (long)cnt * b (long)cnt b long diff = n - (long)cnt * (a + b); diff n - (long)cnt * (a + b) n (long)cnt * (a + b) (long)cnt (a + b) a b ans += diff > a ? diff - a : 0 ans diff > a ? diff - a : 0 diff > a diff a diff - a diff a 0 System.out.println(n - ans) System.out.println System.out System System.out n - ans n ans String[] args args public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] temp = scanner.nextLine().split(" ");
		long n = Long.parseLong(temp[0]);
		long a = Long.parseLong(temp[1]);
		long b = Long.parseLong(temp[2]);

		double cnt = Math.floor(n / (double)(a + b));
		long ans = (long)cnt * b;


		long diff = n - (long)cnt * (a + b);

		ans += diff > a ? diff - a : 0;

		System.out.println(n - ans);


	}
} public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] temp = scanner.nextLine().split(" ");
		long n = Long.parseLong(temp[0]);
		long a = Long.parseLong(temp[1]);
		long b = Long.parseLong(temp[2]);

		double cnt = Math.floor(n / (double)(a + b));
		long ans = (long)cnt * b;


		long diff = n - (long)cnt * (a + b);

		ans += diff > a ? diff - a : 0;

		System.out.println(n - ans);


	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] temp = scanner.nextLine().split(" ");
		long n = Long.parseLong(temp[0]);
		long a = Long.parseLong(temp[1]);
		long b = Long.parseLong(temp[2]);

		double cnt = Math.floor(n / (double)(a + b));
		long ans = (long)cnt * b;


		long diff = n - (long)cnt * (a + b);

		ans += diff > a ? diff - a : 0;

		System.out.println(n - ans);


	}
}