import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int LEN = (int)1e6 + 1;

	void doIt() {
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long cnt = 0l;
		cnt += (N / (A + B)) * A;
		cnt += Math.min((N % (A + B)), A);
		System.out.println(cnt);
	}

	public static void main(String[] args) {
		new Main().doIt();
	}

} import java.util.*; util.* java public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int LEN = (int)1e6 + 1;

	void doIt() {
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long cnt = 0l;
		cnt += (N / (A + B)) * A;
		cnt += Math.min((N % (A + B)), A);
		System.out.println(cnt);
	}

	public static void main(String[] args) {
		new Main().doIt();
	}

} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int MOD = 1000000007; MOD 1000000007 final int MAX = Integer.MAX_VALUE; MAX Integer.MAX_VALUE Integer Integer.MAX_VALUE final long LMAX = Long.MAX_VALUE; LMAX Long.MAX_VALUE Long Long.MAX_VALUE int LEN = (int)1e6 + 1; LEN (int)1e6 + 1 (int)1e6 1 void doIt() {
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long cnt = 0l;
		cnt += (N / (A + B)) * A;
		cnt += Math.min((N % (A + B)), A);
		System.out.println(cnt);
	} doIt {
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long cnt = 0l;
		cnt += (N / (A + B)) * A;
		cnt += Math.min((N % (A + B)), A);
		System.out.println(cnt);
	} 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 cnt = 0l; cnt 0l cnt += (N / (A + B)) * A cnt (N / (A + B)) * A (N / (A + B)) N (A + B) A B A cnt += Math.min((N % (A + B)), A) cnt Math.min((N % (A + B)), A) Math.min Math (N % (A + B)) N (A + B) A B A System.out.println(cnt) System.out.println System.out System System.out cnt public static void main(String[] args) {
		new Main().doIt();
	} main {
		new Main().doIt();
	} new Main().doIt() new Main().doIt new Main() String[] args args public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int LEN = (int)1e6 + 1;

	void doIt() {
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long cnt = 0l;
		cnt += (N / (A + B)) * A;
		cnt += Math.min((N % (A + B)), A);
		System.out.println(cnt);
	}

	public static void main(String[] args) {
		new Main().doIt();
	}

} public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int LEN = (int)1e6 + 1;

	void doIt() {
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long cnt = 0l;
		cnt += (N / (A + B)) * A;
		cnt += Math.min((N % (A + B)), A);
		System.out.println(cnt);
	}

	public static void main(String[] args) {
		new Main().doIt();
	}

} Main
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int LEN = (int)1e6 + 1;

	void doIt() {
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long cnt = 0l;
		cnt += (N / (A + B)) * A;
		cnt += Math.min((N % (A + B)), A);
		System.out.println(cnt);
	}

	public static void main(String[] args) {
		new Main().doIt();
	}

}
