import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
		long sum = a * (n / (a + b));
		sum += a < n%(a+b) ? a : n%(a+b);

		System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
		long sum = a * (n / (a + b));
		sum += a < n%(a+b) ? a : n%(a+b);

		System.out.println(sum);
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
		long sum = a * (n / (a + b));
		sum += a < n%(a+b) ? a : n%(a+b);

		System.out.println(sum);
	} main {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
		long sum = a * (n / (a + b));
		sum += a < n%(a+b) ? a : n%(a+b);

		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong() n sc.nextLong() sc.nextLong sc a = sc.nextLong() a sc.nextLong() sc.nextLong sc b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long sum = a * (n / (a + b)); sum a * (n / (a + b)) a (n / (a + b)) n (a + b) a b sum += a < n%(a+b) ? a : n%(a+b) sum a < n%(a+b) ? a : n%(a+b) a < n%(a+b) a n%(a+b) n (a+b) a b a n%(a+b) n (a+b) a b System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
		long sum = a * (n / (a + b));
		sum += a < n%(a+b) ? a : n%(a+b);

		System.out.println(sum);
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
		long sum = a * (n / (a + b));
		sum += a < n%(a+b) ? a : n%(a+b);

		System.out.println(sum);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
		long sum = a * (n / (a + b));
		sum += a < n%(a+b) ? a : n%(a+b);

		System.out.println(sum);
	}
}