import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        if (a == 0) {
            System.out.println(0);
            return;
        }
        long b = sc.nextLong();

        long count = n / (a + b);
        n %= a + b;
        long ans = count * a;

        System.out.println(ans + Math.min(a, n));
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        if (a == 0) {
            System.out.println(0);
            return;
        }
        long b = sc.nextLong();

        long count = n / (a + b);
        n %= a + b;
        long ans = count * a;

        System.out.println(ans + Math.min(a, n));
    }
} Main public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        if (a == 0) {
            System.out.println(0);
            return;
        }
        long b = sc.nextLong();

        long count = n / (a + b);
        n %= a + b;
        long ans = count * a;

        System.out.println(ans + Math.min(a, n));
    } main {
        // write your code here
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        if (a == 0) {
            System.out.println(0);
            return;
        }
        long b = sc.nextLong();

        long count = n / (a + b);
        n %= a + b;
        long ans = count * a;

        System.out.println(ans + Math.min(a, n));
    } 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 if (a == 0) {
            System.out.println(0);
            return;
        } a == 0 a 0 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long count = n / (a + b); count n / (a + b) n (a + b) a b n %= a + b n a + b a b long ans = count * a; ans count * a count a System.out.println(ans + Math.min(a, n)) System.out.println System.out System System.out ans + Math.min(a, n) ans Math.min(a, n) Math.min Math a n String[] args args public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        if (a == 0) {
            System.out.println(0);
            return;
        }
        long b = sc.nextLong();

        long count = n / (a + b);
        n %= a + b;
        long ans = count * a;

        System.out.println(ans + Math.min(a, n));
    }
} public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        if (a == 0) {
            System.out.println(0);
            return;
        }
        long b = sc.nextLong();

        long count = n / (a + b);
        n %= a + b;
        long ans = count * a;

        System.out.println(ans + Math.min(a, n));
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        if (a == 0) {
            System.out.println(0);
            return;
        }
        long b = sc.nextLong();

        long count = n / (a + b);
        n %= a + b;
        long ans = count * a;

        System.out.println(ans + Math.min(a, n));
    }
}
