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