import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        long checkNum;
        long blueBall;
        long redBall;

        Scanner scanner = new Scanner(System.in);
        String inputData = scanner.nextLine();
        scanner.close();

        String[] editedInputData = inputData.split(" ");
        checkNum = Long.parseLong(editedInputData[0]);
        blueBall = Long.parseLong(editedInputData[1]);
        redBall = Long.parseLong(editedInputData[2]);

        long blueAndRed = blueBall + redBall;
        long countBall = checkNum % blueAndRed;
        long blueAndRedBallSet = checkNum / blueAndRed;
        
        long totalBlueBall = blueAndRedBallSet * blueBall;

        if (countBall <= blueBall) {
            totalBlueBall += countBall;
        } else {
            totalBlueBall += blueBall;
        }

        System.out.println(totalBlueBall);

    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        long checkNum;
        long blueBall;
        long redBall;

        Scanner scanner = new Scanner(System.in);
        String inputData = scanner.nextLine();
        scanner.close();

        String[] editedInputData = inputData.split(" ");
        checkNum = Long.parseLong(editedInputData[0]);
        blueBall = Long.parseLong(editedInputData[1]);
        redBall = Long.parseLong(editedInputData[2]);

        long blueAndRed = blueBall + redBall;
        long countBall = checkNum % blueAndRed;
        long blueAndRedBallSet = checkNum / blueAndRed;
        
        long totalBlueBall = blueAndRedBallSet * blueBall;

        if (countBall <= blueBall) {
            totalBlueBall += countBall;
        } else {
            totalBlueBall += blueBall;
        }

        System.out.println(totalBlueBall);

    }
} Main public static void main(String[] args) throws Exception {
        long checkNum;
        long blueBall;
        long redBall;

        Scanner scanner = new Scanner(System.in);
        String inputData = scanner.nextLine();
        scanner.close();

        String[] editedInputData = inputData.split(" ");
        checkNum = Long.parseLong(editedInputData[0]);
        blueBall = Long.parseLong(editedInputData[1]);
        redBall = Long.parseLong(editedInputData[2]);

        long blueAndRed = blueBall + redBall;
        long countBall = checkNum % blueAndRed;
        long blueAndRedBallSet = checkNum / blueAndRed;
        
        long totalBlueBall = blueAndRedBallSet * blueBall;

        if (countBall <= blueBall) {
            totalBlueBall += countBall;
        } else {
            totalBlueBall += blueBall;
        }

        System.out.println(totalBlueBall);

    } main {
        long checkNum;
        long blueBall;
        long redBall;

        Scanner scanner = new Scanner(System.in);
        String inputData = scanner.nextLine();
        scanner.close();

        String[] editedInputData = inputData.split(" ");
        checkNum = Long.parseLong(editedInputData[0]);
        blueBall = Long.parseLong(editedInputData[1]);
        redBall = Long.parseLong(editedInputData[2]);

        long blueAndRed = blueBall + redBall;
        long countBall = checkNum % blueAndRed;
        long blueAndRedBallSet = checkNum / blueAndRed;
        
        long totalBlueBall = blueAndRedBallSet * blueBall;

        if (countBall <= blueBall) {
            totalBlueBall += countBall;
        } else {
            totalBlueBall += blueBall;
        }

        System.out.println(totalBlueBall);

    } long checkNum; checkNum long blueBall; blueBall long redBall; redBall Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String inputData = scanner.nextLine(); inputData scanner.nextLine() scanner.nextLine scanner scanner.close() scanner.close scanner String[] editedInputData = inputData.split(" "); editedInputData inputData.split(" ") inputData.split inputData " " checkNum = Long.parseLong(editedInputData[0]) checkNum Long.parseLong(editedInputData[0]) Long.parseLong Long editedInputData[0] editedInputData 0 blueBall = Long.parseLong(editedInputData[1]) blueBall Long.parseLong(editedInputData[1]) Long.parseLong Long editedInputData[1] editedInputData 1 redBall = Long.parseLong(editedInputData[2]) redBall Long.parseLong(editedInputData[2]) Long.parseLong Long editedInputData[2] editedInputData 2 long blueAndRed = blueBall + redBall; blueAndRed blueBall + redBall blueBall redBall long countBall = checkNum % blueAndRed; countBall checkNum % blueAndRed checkNum blueAndRed long blueAndRedBallSet = checkNum / blueAndRed; blueAndRedBallSet checkNum / blueAndRed checkNum blueAndRed long totalBlueBall = blueAndRedBallSet * blueBall; totalBlueBall blueAndRedBallSet * blueBall blueAndRedBallSet blueBall if (countBall <= blueBall) {
            totalBlueBall += countBall;
        } else {
            totalBlueBall += blueBall;
        } countBall <= blueBall countBall blueBall {
            totalBlueBall += countBall;
        } totalBlueBall += countBall totalBlueBall countBall {
            totalBlueBall += blueBall;
        } totalBlueBall += blueBall totalBlueBall blueBall System.out.println(totalBlueBall) System.out.println System.out System System.out totalBlueBall String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        long checkNum;
        long blueBall;
        long redBall;

        Scanner scanner = new Scanner(System.in);
        String inputData = scanner.nextLine();
        scanner.close();

        String[] editedInputData = inputData.split(" ");
        checkNum = Long.parseLong(editedInputData[0]);
        blueBall = Long.parseLong(editedInputData[1]);
        redBall = Long.parseLong(editedInputData[2]);

        long blueAndRed = blueBall + redBall;
        long countBall = checkNum % blueAndRed;
        long blueAndRedBallSet = checkNum / blueAndRed;
        
        long totalBlueBall = blueAndRedBallSet * blueBall;

        if (countBall <= blueBall) {
            totalBlueBall += countBall;
        } else {
            totalBlueBall += blueBall;
        }

        System.out.println(totalBlueBall);

    }
} public class Main {
    public static void main(String[] args) throws Exception {
        long checkNum;
        long blueBall;
        long redBall;

        Scanner scanner = new Scanner(System.in);
        String inputData = scanner.nextLine();
        scanner.close();

        String[] editedInputData = inputData.split(" ");
        checkNum = Long.parseLong(editedInputData[0]);
        blueBall = Long.parseLong(editedInputData[1]);
        redBall = Long.parseLong(editedInputData[2]);

        long blueAndRed = blueBall + redBall;
        long countBall = checkNum % blueAndRed;
        long blueAndRedBallSet = checkNum / blueAndRed;
        
        long totalBlueBall = blueAndRedBallSet * blueBall;

        if (countBall <= blueBall) {
            totalBlueBall += countBall;
        } else {
            totalBlueBall += blueBall;
        }

        System.out.println(totalBlueBall);

    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        long checkNum;
        long blueBall;
        long redBall;

        Scanner scanner = new Scanner(System.in);
        String inputData = scanner.nextLine();
        scanner.close();

        String[] editedInputData = inputData.split(" ");
        checkNum = Long.parseLong(editedInputData[0]);
        blueBall = Long.parseLong(editedInputData[1]);
        redBall = Long.parseLong(editedInputData[2]);

        long blueAndRed = blueBall + redBall;
        long countBall = checkNum % blueAndRed;
        long blueAndRedBallSet = checkNum / blueAndRed;
        
        long totalBlueBall = blueAndRedBallSet * blueBall;

        if (countBall <= blueBall) {
            totalBlueBall += countBall;
        } else {
            totalBlueBall += blueBall;
        }

        System.out.println(totalBlueBall);

    }
}