import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);

		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
//		String S = sc.next();
		if(A == 0) {
			System.out.println(0);
			return;
		}

		long block = A + B;
		long aa = N / block;
		long aaa = N % block;

		System.out.println(aa * A + Math.min(A,aaa));

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

		Scanner sc = new Scanner(System.in);

		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
//		String S = sc.next();
		if(A == 0) {
			System.out.println(0);
			return;
		}

		long block = A + B;
		long aa = N / block;
		long aaa = N % block;

		System.out.println(aa * A + Math.min(A,aaa));

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

		Scanner sc = new Scanner(System.in);

		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
//		String S = sc.next();
		if(A == 0) {
			System.out.println(0);
			return;
		}

		long block = A + B;
		long aa = N / block;
		long aaa = N % block;

		System.out.println(aa * A + Math.min(A,aaa));

	} main {

		Scanner sc = new Scanner(System.in);

		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
//		String S = sc.next();
		if(A == 0) {
			System.out.println(0);
			return;
		}

		long block = A + B;
		long aa = N / block;
		long aaa = N % block;

		System.out.println(aa * A + Math.min(A,aaa));

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = Long.parseLong(sc.next()); N Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long A = Long.parseLong(sc.next()); A Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long B = Long.parseLong(sc.next()); B Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc if(A == 0) {
			System.out.println(0);
			return;
		} A == 0 A 0 {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; long block = A + B; block A + B A B long aa = N / block; aa N / block N block long aaa = N % block; aaa N % block N block System.out.println(aa * A + Math.min(A,aaa)) System.out.println System.out System System.out aa * A + Math.min(A,aaa) aa * A aa A Math.min(A,aaa) Math.min Math A aaa String[] args args
import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);

		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
//		String S = sc.next();
		if(A == 0) {
			System.out.println(0);
			return;
		}

		long block = A + B;
		long aa = N / block;
		long aaa = N % block;

		System.out.println(aa * A + Math.min(A,aaa));

	}
}
