import java.util.Scanner;

public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] arg){
        Main m = new Main();
        m.run();
    }

    void run(){
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long div = n/(a+b);
        long mod = n%(a+b);

        System.out.println( (div * a) + Math.min(mod,a));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] arg){
        Main m = new Main();
        m.run();
    }

    void run(){
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long div = n/(a+b);
        long mod = n%(a+b);

        System.out.println( (div * a) + Math.min(mod,a));
    }
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] arg){
        Main m = new Main();
        m.run();
    } main {
        Main m = new Main();
        m.run();
    } Main m = new Main(); m new Main() m.run() m.run m String[] arg arg void run(){
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long div = n/(a+b);
        long mod = n%(a+b);

        System.out.println( (div * a) + Math.min(mod,a));
    } run {
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long div = n/(a+b);
        long mod = n%(a+b);

        System.out.println( (div * a) + Math.min(mod,a));
    } 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 long div = n/(a+b); div n/(a+b) n (a+b) a b long mod = n%(a+b); mod n%(a+b) n (a+b) a b System.out.println( (div * a) + Math.min(mod,a)) System.out.println System.out System System.out (div * a) + Math.min(mod,a) (div * a) div a Math.min(mod,a) Math.min Math mod a public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] arg){
        Main m = new Main();
        m.run();
    }

    void run(){
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long div = n/(a+b);
        long mod = n%(a+b);

        System.out.println( (div * a) + Math.min(mod,a));
    }
} public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] arg){
        Main m = new Main();
        m.run();
    }

    void run(){
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long div = n/(a+b);
        long mod = n%(a+b);

        System.out.println( (div * a) + Math.min(mod,a));
    }
} Main
import java.util.Scanner;

public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] arg){
        Main m = new Main();
        m.run();
    }

    void run(){
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long div = n/(a+b);
        long mod = n%(a+b);

        System.out.println( (div * a) + Math.min(mod,a));
    }
}
