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 t1 = (n / (a + b)) * a;
		long t2 = n % (a + b) > a ? a : n % (a + b);

		sc.close();
			System.out.println(t1 + t2);


	}

} 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 t1 = (n / (a + b)) * a;
		long t2 = n % (a + b) > a ? a : n % (a + b);

		sc.close();
			System.out.println(t1 + t2);


	}

} 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 t1 = (n / (a + b)) * a;
		long t2 = n % (a + b) > a ? a : n % (a + b);

		sc.close();
			System.out.println(t1 + t2);


	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();

		long t1 = (n / (a + b)) * a;
		long t2 = n % (a + b) > a ? a : n % (a + b);

		sc.close();
			System.out.println(t1 + t2);


	} 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 t1 = (n / (a + b)) * a; t1 (n / (a + b)) * a (n / (a + b)) n (a + b) a b a long t2 = n % (a + b) > a ? a : n % (a + b); t2 n % (a + b) > a ? a : n % (a + b) n % (a + b) > a n % (a + b) n (a + b) a b a a n % (a + b) n (a + b) a b sc.close() sc.close sc System.out.println(t1 + t2) System.out.println System.out System System.out t1 + t2 t1 t2 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 t1 = (n / (a + b)) * a;
		long t2 = n % (a + b) > a ? a : n % (a + b);

		sc.close();
			System.out.println(t1 + t2);


	}

} 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 t1 = (n / (a + b)) * a;
		long t2 = n % (a + b) > a ? a : n % (a + b);

		sc.close();
			System.out.println(t1 + t2);


	}

} 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 t1 = (n / (a + b)) * a;
		long t2 = n % (a + b) > a ? a : n % (a + b);

		sc.close();
			System.out.println(t1 + t2);


	}

}
