import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static final int MOD = 1000000007;
	public static final int M = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		long n = parseLong(sc.next());
		long a = parseLong(sc.next());
		long b = parseLong(sc.next());
		sc.close();
		long c = n / (a+b);
		long d = n % (a+b);
		out.println(c*a+Math.min(a, d));
	}
} import java.util.*; util.* java import java.io.PrintWriter; PrintWriter java.io import static java.lang.Integer.*; import static java.lang.Integer.*; import static java.lang.Integer.*; import static java.lang.Long.*; import static java.lang.Long.*; import static java.lang.Long.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {
	public static final int MOD = 1000000007;
	public static final int M = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		long n = parseLong(sc.next());
		long a = parseLong(sc.next());
		long b = parseLong(sc.next());
		sc.close();
		long c = n / (a+b);
		long d = n % (a+b);
		out.println(c*a+Math.min(a, d));
	}
} Main public static final int MOD = 1000000007; MOD 1000000007 public static final int M = 3; M 3 public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		long n = parseLong(sc.next());
		long a = parseLong(sc.next());
		long b = parseLong(sc.next());
		sc.close();
		long c = n / (a+b);
		long d = n % (a+b);
		out.println(c*a+Math.min(a, d));
	} main {
		int i,j;
		Scanner sc = new Scanner(in);
		long n = parseLong(sc.next());
		long a = parseLong(sc.next());
		long b = parseLong(sc.next());
		sc.close();
		long c = n / (a+b);
		long d = n % (a+b);
		out.println(c*a+Math.min(a, d));
	} int i i j; j Scanner sc = new Scanner(in); sc new Scanner(in) long n = parseLong(sc.next()); n parseLong(sc.next()) parseLong sc.next() sc.next sc long a = parseLong(sc.next()); a parseLong(sc.next()) parseLong sc.next() sc.next sc long b = parseLong(sc.next()); b parseLong(sc.next()) parseLong sc.next() sc.next sc sc.close() sc.close sc long c = n / (a+b); c n / (a+b) n (a+b) a b long d = n % (a+b); d n % (a+b) n (a+b) a b out.println(c*a+Math.min(a, d)) out.println out c*a+Math.min(a, d) c*a c a Math.min(a, d) Math.min Math a d String[] args args public class Main {
	public static final int MOD = 1000000007;
	public static final int M = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		long n = parseLong(sc.next());
		long a = parseLong(sc.next());
		long b = parseLong(sc.next());
		sc.close();
		long c = n / (a+b);
		long d = n % (a+b);
		out.println(c*a+Math.min(a, d));
	}
} public class Main {
	public static final int MOD = 1000000007;
	public static final int M = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		long n = parseLong(sc.next());
		long a = parseLong(sc.next());
		long b = parseLong(sc.next());
		sc.close();
		long c = n / (a+b);
		long d = n % (a+b);
		out.println(c*a+Math.min(a, d));
	}
} Main
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static final int MOD = 1000000007;
	public static final int M = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		long n = parseLong(sc.next());
		long a = parseLong(sc.next());
		long b = parseLong(sc.next());
		sc.close();
		long c = n / (a+b);
		long d = n % (a+b);
		out.println(c*a+Math.min(a, d));
	}
}
