import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long a = scanner.nextLong();
		long b = scanner.nextLong();

		long ans = 0;
		if(a + b > 0){
			long big = n/(a+b);
			long small = n%(a+b);
			long ss = Math.min(small, a);


			ans = big*a + ss;
		}

		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long a = scanner.nextLong();
		long b = scanner.nextLong();

		long ans = 0;
		if(a + b > 0){
			long big = n/(a+b);
			long small = n%(a+b);
			long ss = Math.min(small, a);


			ans = big*a + ss;
		}

		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long a = scanner.nextLong();
		long b = scanner.nextLong();

		long ans = 0;
		if(a + b > 0){
			long big = n/(a+b);
			long small = n%(a+b);
			long ss = Math.min(small, a);


			ans = big*a + ss;
		}

		System.out.println(ans);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long a = scanner.nextLong();
		long b = scanner.nextLong();

		long ans = 0;
		if(a + b > 0){
			long big = n/(a+b);
			long small = n%(a+b);
			long ss = Math.min(small, a);


			ans = big*a + ss;
		}

		System.out.println(ans);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long n = scanner.nextLong(); n scanner.nextLong() scanner.nextLong scanner long a = scanner.nextLong(); a scanner.nextLong() scanner.nextLong scanner long b = scanner.nextLong(); b scanner.nextLong() scanner.nextLong scanner long ans = 0; ans 0 if(a + b > 0){
			long big = n/(a+b);
			long small = n%(a+b);
			long ss = Math.min(small, a);


			ans = big*a + ss;
		} a + b > 0 a + b a b 0 {
			long big = n/(a+b);
			long small = n%(a+b);
			long ss = Math.min(small, a);


			ans = big*a + ss;
		} long big = n/(a+b); big n/(a+b) n (a+b) a b long small = n%(a+b); small n%(a+b) n (a+b) a b long ss = Math.min(small, a); ss Math.min(small, a) Math.min Math small a ans = big*a + ss ans big*a + ss big*a big a ss 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) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long a = scanner.nextLong();
		long b = scanner.nextLong();

		long ans = 0;
		if(a + b > 0){
			long big = n/(a+b);
			long small = n%(a+b);
			long ss = Math.min(small, a);


			ans = big*a + ss;
		}

		System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long a = scanner.nextLong();
		long b = scanner.nextLong();

		long ans = 0;
		if(a + b > 0){
			long big = n/(a+b);
			long small = n%(a+b);
			long ss = Math.min(small, a);


			ans = big*a + ss;
		}

		System.out.println(ans);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long a = scanner.nextLong();
		long b = scanner.nextLong();

		long ans = 0;
		if(a + b > 0){
			long big = n/(a+b);
			long small = n%(a+b);
			long ss = Math.min(small, a);


			ans = big*a + ss;
		}

		System.out.println(ans);
	}

}
