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 ans;
		ans = n / (a + b);
		ans = ans * a;
		n = n % (a + b);
		ans += Math.min(a, n);
		System.out.println(ans);
		sc.close();
	}
} 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 ans;
		ans = n / (a + b);
		ans = ans * a;
		n = n % (a + b);
		ans += Math.min(a, n);
		System.out.println(ans);
		sc.close();
	}
} 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 ans;
		ans = n / (a + b);
		ans = ans * a;
		n = n % (a + b);
		ans += Math.min(a, n);
		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		long ans;
		ans = n / (a + b);
		ans = ans * a;
		n = n % (a + b);
		ans += Math.min(a, n);
		System.out.println(ans);
		sc.close();
	} 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 ans; ans ans = n / (a + b) ans n / (a + b) n (a + b) a b ans = ans * a ans ans * a ans a n = n % (a + b) n n % (a + b) n (a + b) a b ans += Math.min(a, n) ans Math.min(a, n) Math.min Math a n System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc 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 ans;
		ans = n / (a + b);
		ans = ans * a;
		n = n % (a + b);
		ans += Math.min(a, n);
		System.out.println(ans);
		sc.close();
	}
} 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 ans;
		ans = n / (a + b);
		ans = ans * a;
		n = n % (a + b);
		ans += Math.min(a, n);
		System.out.println(ans);
		sc.close();
	}
} 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 ans;
		ans = n / (a + b);
		ans = ans * a;
		n = n % (a + b);
		ans += Math.min(a, n);
		System.out.println(ans);
		sc.close();
	}
}