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