import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final long N = Long.parseLong(sc.next());
        long blue = Long.parseLong(sc.next());
        long red = Long.parseLong(sc.next());
        
        out.println(N / (blue + red) * blue + Math.min(blue, N % (blue + red)));
        
        out.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final long N = Long.parseLong(sc.next());
        long blue = Long.parseLong(sc.next());
        long red = Long.parseLong(sc.next());
        
        out.println(N / (blue + red) * blue + Math.min(blue, N % (blue + red)));
        
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final long N = Long.parseLong(sc.next());
        long blue = Long.parseLong(sc.next());
        long red = Long.parseLong(sc.next());
        
        out.println(N / (blue + red) * blue + Math.min(blue, N % (blue + red)));
        
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final long N = Long.parseLong(sc.next());
        long blue = Long.parseLong(sc.next());
        long red = Long.parseLong(sc.next());
        
        out.println(N / (blue + red) * blue + Math.min(blue, N % (blue + red)));
        
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) final long N = Long.parseLong(sc.next()); N Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long blue = Long.parseLong(sc.next()); blue Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long red = Long.parseLong(sc.next()); red Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc out.println(N / (blue + red) * blue + Math.min(blue, N % (blue + red))) out.println out N / (blue + red) * blue + Math.min(blue, N % (blue + red)) N / (blue + red) * blue N / (blue + red) N (blue + red) blue red blue Math.min(blue, N % (blue + red)) Math.min Math blue N % (blue + red) N (blue + red) blue red out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final long N = Long.parseLong(sc.next());
        long blue = Long.parseLong(sc.next());
        long red = Long.parseLong(sc.next());
        
        out.println(N / (blue + red) * blue + Math.min(blue, N % (blue + red)));
        
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final long N = Long.parseLong(sc.next());
        long blue = Long.parseLong(sc.next());
        long red = Long.parseLong(sc.next());
        
        out.println(N / (blue + red) * blue + Math.min(blue, N % (blue + red)));
        
        out.flush();
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        final long N = Long.parseLong(sc.next());
        long blue = Long.parseLong(sc.next());
        long red = Long.parseLong(sc.next());
        
        out.println(N / (blue + red) * blue + Math.min(blue, N % (blue + red)));
        
        out.flush();
    }
}