import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Scanner;
import java.lang.*;
import java.io.*;
import java.util.*;
import java.lang.Integer;
import java.util.HashMap;

class Main
{
    // driver function to test the above functions
    public static void main(String args[]) throws IOException
    {
        Reader.init(System.in);
        long n = Reader.nextLong();
        long a = Reader.nextLong();
        long b = Reader.nextLong();

        long tot=a+b;
        long ans=0;
        long base = n%tot;

        if (base>a){
            ans=ans+a;
        }

        else {
            ans=base;
        }

        long div = n/tot;
        ans=ans+(div*a);
        System.out.println(ans);


    }

}

class solu{

}

/** Class for buffered reading int and double values */
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util import java.util.Scanner; Scanner java.util import java.lang.*; lang.* java import java.io.*; io.* java import java.util.*; util.* java import java.lang.Integer; Integer java.lang import java.util.HashMap; HashMap java.util class Main
{
    // driver function to test the above functions
    public static void main(String args[]) throws IOException
    {
        Reader.init(System.in);
        long n = Reader.nextLong();
        long a = Reader.nextLong();
        long b = Reader.nextLong();

        long tot=a+b;
        long ans=0;
        long base = n%tot;

        if (base>a){
            ans=ans+a;
        }

        else {
            ans=base;
        }

        long div = n/tot;
        ans=ans+(div*a);
        System.out.println(ans);


    }

} Main // driver function to test the above functions
    public static void main(String args[]) throws IOException
    {
        Reader.init(System.in);
        long n = Reader.nextLong();
        long a = Reader.nextLong();
        long b = Reader.nextLong();

        long tot=a+b;
        long ans=0;
        long base = n%tot;

        if (base>a){
            ans=ans+a;
        }

        else {
            ans=base;
        }

        long div = n/tot;
        ans=ans+(div*a);
        System.out.println(ans);


    } main {
        Reader.init(System.in);
        long n = Reader.nextLong();
        long a = Reader.nextLong();
        long b = Reader.nextLong();

        long tot=a+b;
        long ans=0;
        long base = n%tot;

        if (base>a){
            ans=ans+a;
        }

        else {
            ans=base;
        }

        long div = n/tot;
        ans=ans+(div*a);
        System.out.println(ans);


    } Reader.init(System.in) Reader.init Reader System.in System System.in long n = Reader.nextLong(); n Reader.nextLong() Reader.nextLong Reader long a = Reader.nextLong(); a Reader.nextLong() Reader.nextLong Reader long b = Reader.nextLong(); b Reader.nextLong() Reader.nextLong Reader long tot=a+b; tot a+b a b long ans=0; ans 0 long base = n%tot; base n%tot n tot if (base>a){
            ans=ans+a;
        }

        else {
            ans=base;
        } base>a base a {
            ans=ans+a;
        } ans=ans+a ans ans+a ans a {
            ans=base;
        } ans=base ans base long div = n/tot; div n/tot n tot ans=ans+(div*a) ans ans+(div*a) ans (div*a) div a System.out.println(ans) System.out.println System.out System System.out ans String args[] args class solu{

} solu class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
} Reader static BufferedReader reader; reader static StringTokenizer tokenizer; tokenizer /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    } init {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    } reader = new BufferedReader(
                new InputStreamReader(input) ) reader new BufferedReader(
                new InputStreamReader(input) ) tokenizer = new StringTokenizer("") tokenizer new StringTokenizer("") InputStream input input /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    } next {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    } while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        } ! tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        } tokenizer = new StringTokenizer(
                    reader.readLine() ) tokenizer new StringTokenizer(
                    reader.readLine() ) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    } nextInt {
        return Integer.parseInt( next() );
    } return Integer.parseInt( next() ); Integer.parseInt( next() ) Integer.parseInt Integer next() next static long nextLong() throws IOException {
        return Long.parseLong( next() );
    } nextLong {
        return Long.parseLong( next() );
    } return Long.parseLong( next() ); Long.parseLong( next() ) Long.parseLong Long next() next static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    } nextDouble {
        return Double.parseDouble( next() );
    } return Double.parseDouble( next() ); Double.parseDouble( next() ) Double.parseDouble Double next() next
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Scanner;
import java.lang.*;
import java.io.*;
import java.util.*;
import java.lang.Integer;
import java.util.HashMap;

class Main
{
    // driver function to test the above functions
    public static void main(String args[]) throws IOException
    {
        Reader.init(System.in);
        long n = Reader.nextLong();
        long a = Reader.nextLong();
        long b = Reader.nextLong();

        long tot=a+b;
        long ans=0;
        long base = n%tot;

        if (base>a){
            ans=ans+a;
        }

        else {
            ans=base;
        }

        long div = n/tot;
        ans=ans+(div*a);
        System.out.println(ans);


    }

}

class solu{

}

/** Class for buffered reading int and double values */
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}