import java.util.Scanner;

public class Main {


	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long r = a * (n / (a+b));
		long k = n % (a+b);
		r += (  k < a ? k : a  );

		System.out.println(r);
	}

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


	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long r = a * (n / (a+b));
		long k = n % (a+b);
		r += (  k < a ? k : a  );

		System.out.println(r);
	}

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

		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long r = a * (n / (a+b));
		long k = n % (a+b);
		r += (  k < a ? k : a  );

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

		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long r = a * (n / (a+b));
		long k = n % (a+b);
		r += (  k < a ? k : a  );

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


	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long r = a * (n / (a+b));
		long k = n % (a+b);
		r += (  k < a ? k : a  );

		System.out.println(r);
	}

} public class Main {


	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long r = a * (n / (a+b));
		long k = n % (a+b);
		r += (  k < a ? k : a  );

		System.out.println(r);
	}

} Main
import java.util.Scanner;

public class Main {


	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long r = a * (n / (a+b));
		long k = n % (a+b);
		r += (  k < a ? k : a  );

		System.out.println(r);
	}

}
