import java.util.Scanner;

public class Main
{
    public static void main(String [] args)
    {
        Scanner key = new Scanner(System.in);
        long num = key.nextLong();
        long blue = key.nextLong();
        long red = key.nextLong();
        
        long total = num % (blue+red);
        long rem = (num - total)/(blue+red)*blue;

        if(total - blue >= 0)
        {
            rem = rem + blue;
        }
        else
        {
            rem = rem + total;
        }

        System.out.println(rem);


    }
} import java.util.Scanner; Scanner java.util public class Main
{
    public static void main(String [] args)
    {
        Scanner key = new Scanner(System.in);
        long num = key.nextLong();
        long blue = key.nextLong();
        long red = key.nextLong();
        
        long total = num % (blue+red);
        long rem = (num - total)/(blue+red)*blue;

        if(total - blue >= 0)
        {
            rem = rem + blue;
        }
        else
        {
            rem = rem + total;
        }

        System.out.println(rem);


    }
} Main public static void main(String [] args)
    {
        Scanner key = new Scanner(System.in);
        long num = key.nextLong();
        long blue = key.nextLong();
        long red = key.nextLong();
        
        long total = num % (blue+red);
        long rem = (num - total)/(blue+red)*blue;

        if(total - blue >= 0)
        {
            rem = rem + blue;
        }
        else
        {
            rem = rem + total;
        }

        System.out.println(rem);


    } main {
        Scanner key = new Scanner(System.in);
        long num = key.nextLong();
        long blue = key.nextLong();
        long red = key.nextLong();
        
        long total = num % (blue+red);
        long rem = (num - total)/(blue+red)*blue;

        if(total - blue >= 0)
        {
            rem = rem + blue;
        }
        else
        {
            rem = rem + total;
        }

        System.out.println(rem);


    } Scanner key = new Scanner(System.in); key new Scanner(System.in) long num = key.nextLong(); num key.nextLong() key.nextLong key long blue = key.nextLong(); blue key.nextLong() key.nextLong key long red = key.nextLong(); red key.nextLong() key.nextLong key long total = num % (blue+red); total num % (blue+red) num (blue+red) blue red long rem = (num - total)/(blue+red)*blue; rem (num - total)/(blue+red)*blue (num - total)/(blue+red) (num - total) num total (blue+red) blue red blue if(total - blue >= 0)
        {
            rem = rem + blue;
        }
        else
        {
            rem = rem + total;
        } total - blue >= 0 total - blue total blue 0 {
            rem = rem + blue;
        } rem = rem + blue rem rem + blue rem blue {
            rem = rem + total;
        } rem = rem + total rem rem + total rem total System.out.println(rem) System.out.println System.out System System.out rem String [] args args public class Main
{
    public static void main(String [] args)
    {
        Scanner key = new Scanner(System.in);
        long num = key.nextLong();
        long blue = key.nextLong();
        long red = key.nextLong();
        
        long total = num % (blue+red);
        long rem = (num - total)/(blue+red)*blue;

        if(total - blue >= 0)
        {
            rem = rem + blue;
        }
        else
        {
            rem = rem + total;
        }

        System.out.println(rem);


    }
} public class Main
{
    public static void main(String [] args)
    {
        Scanner key = new Scanner(System.in);
        long num = key.nextLong();
        long blue = key.nextLong();
        long red = key.nextLong();
        
        long total = num % (blue+red);
        long rem = (num - total)/(blue+red)*blue;

        if(total - blue >= 0)
        {
            rem = rem + blue;
        }
        else
        {
            rem = rem + total;
        }

        System.out.println(rem);


    }
} Main
import java.util.Scanner;

public class Main
{
    public static void main(String [] args)
    {
        Scanner key = new Scanner(System.in);
        long num = key.nextLong();
        long blue = key.nextLong();
        long red = key.nextLong();
        
        long total = num % (blue+red);
        long rem = (num - total)/(blue+red)*blue;

        if(total - blue >= 0)
        {
            rem = rem + blue;
        }
        else
        {
            rem = rem + total;
        }

        System.out.println(rem);


    }
}