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 remain = N % (A + B);
        if (remain>A) {
            remain=A;
        }
        long num= N / (A + B);

        System.out.println(num*A+remain);

        sc.close();

    }
} 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 remain = N % (A + B);
        if (remain>A) {
            remain=A;
        }
        long num= N / (A + B);

        System.out.println(num*A+remain);

        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 remain = N % (A + B);
        if (remain>A) {
            remain=A;
        }
        long num= N / (A + B);

        System.out.println(num*A+remain);

        sc.close();

    } main {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long remain = N % (A + B);
        if (remain>A) {
            remain=A;
        }
        long num= N / (A + B);

        System.out.println(num*A+remain);

        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 remain = N % (A + B); remain N % (A + B) N (A + B) A B if (remain>A) {
            remain=A;
        } remain>A remain A {
            remain=A;
        } remain=A remain A long num= N / (A + B); num N / (A + B) N (A + B) A B System.out.println(num*A+remain) System.out.println System.out System System.out num*A+remain num*A num A remain 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 remain = N % (A + B);
        if (remain>A) {
            remain=A;
        }
        long num= N / (A + B);

        System.out.println(num*A+remain);

        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 remain = N % (A + B);
        if (remain>A) {
            remain=A;
        }
        long num= N / (A + B);

        System.out.println(num*A+remain);

        sc.close();

    }
} 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 remain = N % (A + B);
        if (remain>A) {
            remain=A;
        }
        long num= N / (A + B);

        System.out.println(num*A+remain);

        sc.close();

    }
}