import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println((long) Math.floor(n / (a + b)) * a + Math.min(n % (a + b), a));
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println((long) Math.floor(n / (a + b)) * a + Math.min(n % (a + b), a));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println((long) Math.floor(n / (a + b)) * a + Math.min(n % (a + b), a));
	} main {
		Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println((long) Math.floor(n / (a + b)) * a + Math.min(n % (a + b), a));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = Long.parseLong(sc.next()); n Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long a = Long.parseLong(sc.next()); a Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long b = Long.parseLong(sc.next()); b Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc System.out.println((long) Math.floor(n / (a + b)) * a + Math.min(n % (a + b), a)) System.out.println System.out System System.out (long) Math.floor(n / (a + b)) * a + Math.min(n % (a + b), a) (long) Math.floor(n / (a + b)) * a (long) Math.floor(n / (a + b)) Math.floor Math 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 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println((long) Math.floor(n / (a + b)) * a + Math.min(n % (a + b), a));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println((long) Math.floor(n / (a + b)) * a + Math.min(n % (a + b), a));
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		System.out.println((long) Math.floor(n / (a + b)) * a + Math.min(n % (a + b), a));
	}
}