import java.io.FileNotFoundException;
import java.util.Scanner;

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

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();

		if (A==0) {
			System.out.println("0");
		} else {
			long ans = A*(N/(A+B))+Math.min(A,N%(A+B));
			System.out.println(ans);
		}

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

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();

		if (A==0) {
			System.out.println("0");
		} else {
			long ans = A*(N/(A+B))+Math.min(A,N%(A+B));
			System.out.println(ans);
		}

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

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();

		if (A==0) {
			System.out.println("0");
		} else {
			long ans = A*(N/(A+B))+Math.min(A,N%(A+B));
			System.out.println(ans);
		}

	} main {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();

		if (A==0) {
			System.out.println("0");
		} else {
			long ans = A*(N/(A+B))+Math.min(A,N%(A+B));
			System.out.println(ans);
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc long B = sc.nextLong(); B sc.nextLong() sc.nextLong sc if (A==0) {
			System.out.println("0");
		} else {
			long ans = A*(N/(A+B))+Math.min(A,N%(A+B));
			System.out.println(ans);
		} A==0 A 0 {
			System.out.println("0");
		} System.out.println("0") System.out.println System.out System System.out "0" {
			long ans = A*(N/(A+B))+Math.min(A,N%(A+B));
			System.out.println(ans);
		} long ans = A*(N/(A+B))+Math.min(A,N%(A+B)); ans A*(N/(A+B))+Math.min(A,N%(A+B)) A*(N/(A+B)) A (N/(A+B)) N (A+B) A B Math.min(A,N%(A+B)) Math.min Math A N%(A+B) N (A+B) A B 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) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();

		if (A==0) {
			System.out.println("0");
		} else {
			long ans = A*(N/(A+B))+Math.min(A,N%(A+B));
			System.out.println(ans);
		}

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

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();

		if (A==0) {
			System.out.println("0");
		} else {
			long ans = A*(N/(A+B))+Math.min(A,N%(A+B));
			System.out.println(ans);
		}

	}
} Main
import java.io.FileNotFoundException;
import java.util.Scanner;

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

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();

		if (A==0) {
			System.out.println("0");
		} else {
			long ans = A*(N/(A+B))+Math.min(A,N%(A+B));
			System.out.println(ans);
		}

	}
}