import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();

		long c = n / (a + b);
		long m = n - c * (a + b);
		if(m < a) System.out.println(c * a + m);
		else if(m >= a) System.out.println(c * a + a);
		sc.close();
	}
} 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();
		long a = sc.nextLong();
		long b = sc.nextLong();

		long c = n / (a + b);
		long m = n - c * (a + b);
		if(m < a) System.out.println(c * a + m);
		else if(m >= a) System.out.println(c * a + a);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();

		long c = n / (a + b);
		long m = n - c * (a + b);
		if(m < a) System.out.println(c * a + m);
		else if(m >= a) System.out.println(c * a + a);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();

		long c = n / (a + b);
		long m = n - c * (a + b);
		if(m < a) System.out.println(c * a + m);
		else if(m >= a) System.out.println(c * a + a);
		sc.close();
	} 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 long c = n / (a + b); c n / (a + b) n (a + b) a b long m = n - c * (a + b); m n - c * (a + b) n c * (a + b) c (a + b) a b if(m < a) System.out.println(c * a + m);
		else if(m >= a) System.out.println(c * a + a); m < a m a System.out.println(c * a + m) System.out.println System.out System System.out c * a + m c * a c a m if(m >= a) System.out.println(c * a + a); m >= a m a System.out.println(c * a + a) System.out.println System.out System System.out c * a + a c * a c a a sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();

		long c = n / (a + b);
		long m = n - c * (a + b);
		if(m < a) System.out.println(c * a + m);
		else if(m >= a) System.out.println(c * a + a);
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();

		long c = n / (a + b);
		long m = n - c * (a + b);
		if(m < a) System.out.println(c * a + m);
		else if(m >= a) System.out.println(c * a + a);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();

		long c = n / (a + b);
		long m = n - c * (a + b);
		if(m < a) System.out.println(c * a + m);
		else if(m >= a) System.out.println(c * a + a);
		sc.close();
	}
}