import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        sc.close();
        //青いボールの合計個数
        long sumA = N / (A + B) * A;
        long remain = N % (A + B);

        if (remain < A) {
            sumA += remain;
        } else {
            sumA += A;
        }
        System.out.println(sumA);
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        sc.close();
        //青いボールの合計個数
        long sumA = N / (A + B) * A;
        long remain = N % (A + B);

        if (remain < A) {
            sumA += remain;
        } else {
            sumA += A;
        }
        System.out.println(sumA);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        sc.close();
        //青いボールの合計個数
        long sumA = N / (A + B) * A;
        long remain = N % (A + B);

        if (remain < A) {
            sumA += remain;
        } else {
            sumA += A;
        }
        System.out.println(sumA);
    } main {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        sc.close();
        //青いボールの合計個数
        long sumA = N / (A + B) * A;
        long remain = N % (A + B);

        if (remain < A) {
            sumA += remain;
        } else {
            sumA += A;
        }
        System.out.println(sumA);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = Long.parseLong(sc.next()); N Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long A = Long.parseLong(sc.next()); A Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long B = Long.parseLong(sc.next()); B Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc sc.close() sc.close sc long sumA = N / (A + B) * A; sumA N / (A + B) * A N / (A + B) N (A + B) A B A long remain = N % (A + B); remain N % (A + B) N (A + B) A B if (remain < A) {
            sumA += remain;
        } else {
            sumA += A;
        } remain < A remain A {
            sumA += remain;
        } sumA += remain sumA remain {
            sumA += A;
        } sumA += A sumA A System.out.println(sumA) System.out.println System.out System System.out sumA String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        sc.close();
        //青いボールの合計個数
        long sumA = N / (A + B) * A;
        long remain = N % (A + B);

        if (remain < A) {
            sumA += remain;
        } else {
            sumA += A;
        }
        System.out.println(sumA);
    }

} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        sc.close();
        //青いボールの合計個数
        long sumA = N / (A + B) * A;
        long remain = N % (A + B);

        if (remain < A) {
            sumA += remain;
        } else {
            sumA += A;
        }
        System.out.println(sumA);
    }

} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        sc.close();
        //青いボールの合計個数
        long sumA = N / (A + B) * A;
        long remain = N % (A + B);

        if (remain < A) {
            sumA += remain;
        } else {
            sumA += A;
        }
        System.out.println(sumA);
    }

}