import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long br = b + r;

        long ans = n / br * b;
        long rem = n % br;
        ans += Math.min(rem, b);

        System.out.println(ans);
    }
} 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 b = sc.nextLong();
        long r = sc.nextLong();
        long br = b + r;

        long ans = n / br * b;
        long rem = n % br;
        ans += Math.min(rem, b);

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long br = b + r;

        long ans = n / br * b;
        long rem = n % br;
        ans += Math.min(rem, b);

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long br = b + r;

        long ans = n / br * b;
        long rem = n % br;
        ans += Math.min(rem, b);

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long r = sc.nextLong(); r sc.nextLong() sc.nextLong sc long br = b + r; br b + r b r long ans = n / br * b; ans n / br * b n / br n br b long rem = n % br; rem n % br n br ans += Math.min(rem, b) ans Math.min(rem, b) Math.min Math rem b System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long br = b + r;

        long ans = n / br * b;
        long rem = n % br;
        ans += Math.min(rem, b);

        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long br = b + r;

        long ans = n / br * b;
        long rem = n % br;
        ans += Math.min(rem, b);

        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long br = b + r;

        long ans = n / br * b;
        long rem = n % br;
        ans += Math.min(rem, b);

        System.out.println(ans);
    }
}