import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        //N/(A+B) finds the number of times red and blue balls repeats
        //multiplying by A finds the number of blue balls
        // adding Math.min(N%(A+B),A) finds the number of
        // blue balls the group of red and  blue that wasn't repeated

        System.out.println(N/(A+B) * A + Math.min(N%(A+B),A));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        //N/(A+B) finds the number of times red and blue balls repeats
        //multiplying by A finds the number of blue balls
        // adding Math.min(N%(A+B),A) finds the number of
        // blue balls the group of red and  blue that wasn't repeated

        System.out.println(N/(A+B) * A + Math.min(N%(A+B),A));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        //N/(A+B) finds the number of times red and blue balls repeats
        //multiplying by A finds the number of blue balls
        // adding Math.min(N%(A+B),A) finds the number of
        // blue balls the group of red and  blue that wasn't repeated

        System.out.println(N/(A+B) * A + Math.min(N%(A+B),A));
    } main {
        Scanner sc = new Scanner(System.in);

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

        //N/(A+B) finds the number of times red and blue balls repeats
        //multiplying by A finds the number of blue balls
        // adding Math.min(N%(A+B),A) finds the number of
        // blue balls the group of red and  blue that wasn't repeated

        System.out.println(N/(A+B) * A + Math.min(N%(A+B),A));
    } 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 System.out.println(N/(A+B) * A + Math.min(N%(A+B),A)) System.out.println System.out System System.out N/(A+B) * A + Math.min(N%(A+B),A) N/(A+B) * A N/(A+B) N (A+B) A B A Math.min(N%(A+B),A) Math.min Math N%(A+B) N (A+B) A B A String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        //N/(A+B) finds the number of times red and blue balls repeats
        //multiplying by A finds the number of blue balls
        // adding Math.min(N%(A+B),A) finds the number of
        // blue balls the group of red and  blue that wasn't repeated

        System.out.println(N/(A+B) * A + Math.min(N%(A+B),A));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        //N/(A+B) finds the number of times red and blue balls repeats
        //multiplying by A finds the number of blue balls
        // adding Math.min(N%(A+B),A) finds the number of
        // blue balls the group of red and  blue that wasn't repeated

        System.out.println(N/(A+B) * A + Math.min(N%(A+B),A));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        //N/(A+B) finds the number of times red and blue balls repeats
        //multiplying by A finds the number of blue balls
        // adding Math.min(N%(A+B),A) finds the number of
        // blue balls the group of red and  blue that wasn't repeated

        System.out.println(N/(A+B) * A + Math.min(N%(A+B),A));
    }
}
