import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");

        long n = Long.valueOf(arr01[0]);
        long a = Long.valueOf(arr01[1]);
        long b = Long.valueOf(arr01[2]);

        long sho = n / (a + b);
        long amari = n % (a + b);

        long ball1 = a * sho;
        long ball2 = Math.min(amari, a);

        System.out.println(ball1 + ball2);

    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");

        long n = Long.valueOf(arr01[0]);
        long a = Long.valueOf(arr01[1]);
        long b = Long.valueOf(arr01[2]);

        long sho = n / (a + b);
        long amari = n % (a + b);

        long ball1 = a * sho;
        long ball2 = Math.min(amari, a);

        System.out.println(ball1 + ball2);

    }

} Main public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");

        long n = Long.valueOf(arr01[0]);
        long a = Long.valueOf(arr01[1]);
        long b = Long.valueOf(arr01[2]);

        long sho = n / (a + b);
        long amari = n % (a + b);

        long ball1 = a * sho;
        long ball2 = Math.min(amari, a);

        System.out.println(ball1 + ball2);

    } main {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");

        long n = Long.valueOf(arr01[0]);
        long a = Long.valueOf(arr01[1]);
        long b = Long.valueOf(arr01[2]);

        long sho = n / (a + b);
        long amari = n % (a + b);

        long ball1 = a * sho;
        long ball2 = Math.min(amari, a);

        System.out.println(ball1 + ball2);

    } InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader reader = new BufferedReader(is); reader new BufferedReader(is) List<String> mylist = new ArrayList<>(); mylist new ArrayList<>() String strinput = reader.readLine(); strinput reader.readLine() reader.readLine reader while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        } strinput != null strinput null {

            mylist.add(strinput);
            strinput = reader.readLine();

        } mylist.add(strinput) mylist.add mylist strinput strinput = reader.readLine() strinput reader.readLine() reader.readLine reader String arr01[] = mylist.get(0).split(" "); arr01 mylist.get(0).split(" ") mylist.get(0).split mylist.get(0) mylist.get mylist 0 " " long n = Long.valueOf(arr01[0]); n Long.valueOf(arr01[0]) Long.valueOf Long arr01[0] arr01 0 long a = Long.valueOf(arr01[1]); a Long.valueOf(arr01[1]) Long.valueOf Long arr01[1] arr01 1 long b = Long.valueOf(arr01[2]); b Long.valueOf(arr01[2]) Long.valueOf Long arr01[2] arr01 2 long sho = n / (a + b); sho n / (a + b) n (a + b) a b long amari = n % (a + b); amari n % (a + b) n (a + b) a b long ball1 = a * sho; ball1 a * sho a sho long ball2 = Math.min(amari, a); ball2 Math.min(amari, a) Math.min Math amari a System.out.println(ball1 + ball2) System.out.println System.out System System.out ball1 + ball2 ball1 ball2 String[] args args public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");

        long n = Long.valueOf(arr01[0]);
        long a = Long.valueOf(arr01[1]);
        long b = Long.valueOf(arr01[2]);

        long sho = n / (a + b);
        long amari = n % (a + b);

        long ball1 = a * sho;
        long ball2 = Math.min(amari, a);

        System.out.println(ball1 + ball2);

    }

} public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");

        long n = Long.valueOf(arr01[0]);
        long a = Long.valueOf(arr01[1]);
        long b = Long.valueOf(arr01[2]);

        long sho = n / (a + b);
        long amari = n % (a + b);

        long ball1 = a * sho;
        long ball2 = Math.min(amari, a);

        System.out.println(ball1 + ball2);

    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");

        long n = Long.valueOf(arr01[0]);
        long a = Long.valueOf(arr01[1]);
        long b = Long.valueOf(arr01[2]);

        long sho = n / (a + b);
        long amari = n % (a + b);

        long ball1 = a * sho;
        long ball2 = Math.min(amari, a);

        System.out.println(ball1 + ball2);

    }

}
