import java.io.*;
import java.util.*;

public class Main extends PrintWriter {
	Main() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	void main() {
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		println(n / (a + b) * a + Math.min(n % (a + b), a));
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main extends PrintWriter {
	Main() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	void main() {
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		println(n / (a + b) * a + Math.min(n % (a + b), a));
	}
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Main() { super(System.out, true); } Main { super(System.out, true); } super(System.out, true) super System.out System System.out true public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	} main {
		Main o = new Main(); o.main(); o.flush();
	} Main o = new Main(); o new Main() o.main() o.main o o.flush() o.flush o String[] $ $ void main() {
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		println(n / (a + b) * a + Math.min(n % (a + b), a));
	} main {
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		println(n / (a + b) * a + Math.min(n % (a + b), a));
	} 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 println(n / (a + b) * a + Math.min(n % (a + b), a)) println n / (a + b) * a + Math.min(n % (a + b), a) n / (a + b) * a n / (a + b) n (a + b) a b a Math.min(n % (a + b), a) Math.min Math n % (a + b) n (a + b) a b a PrintWriter public class Main extends PrintWriter {
	Main() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	void main() {
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		println(n / (a + b) * a + Math.min(n % (a + b), a));
	}
} public class Main extends PrintWriter {
	Main() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	void main() {
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		println(n / (a + b) * a + Math.min(n % (a + b), a));
	}
} Main
import java.io.*;
import java.util.*;

public class Main extends PrintWriter {
	Main() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	void main() {
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		println(n / (a + b) * a + Math.min(n % (a + b), a));
	}
}
