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