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();
        long x = n /(a+b);
        long y = n - (a+b)*x;
        long ans = x*a + Math.min(y, a);
        System.out.println(ans);
        sc.close();

    }

} 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();
        long x = n /(a+b);
        long y = n - (a+b)*x;
        long ans = x*a + Math.min(y, a);
        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 x = n /(a+b);
        long y = n - (a+b)*x;
        long ans = x*a + Math.min(y, a);
        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 x = n /(a+b);
        long y = n - (a+b)*x;
        long ans = x*a + Math.min(y, a);
        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 x = n /(a+b); x n /(a+b) n (a+b) a b long y = n - (a+b)*x; y n - (a+b)*x n (a+b)*x (a+b) a b x long ans = x*a + Math.min(y, a); ans x*a + Math.min(y, a) x*a x a Math.min(y, a) Math.min Math y a 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 x = n /(a+b);
        long y = n - (a+b)*x;
        long ans = x*a + Math.min(y, a);
        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 x = n /(a+b);
        long y = n - (a+b)*x;
        long ans = x*a + Math.min(y, a);
        System.out.println(ans);
        sc.close();

    }

} 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();
        long x = n /(a+b);
        long y = n - (a+b)*x;
        long ans = x*a + Math.min(y, a);
        System.out.println(ans);
        sc.close();

    }

}
