import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int k;
    long[] d;
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException{
        long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
        long t = n/(a+b);
        long r = n%(a+b);
        long ans = t*a+Math.min(r,a);
        System.out.println(ans);
    }
}
 import java.io.*; io.* java import java.util.*; util.* java public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int k;
    long[] d;
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException{
        long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
        long t = n/(a+b);
        long r = n%(a+b);
        long ans = t*a+Math.min(r,a);
        System.out.println(ans);
    }
} Main static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) int k; k long[] d; d public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    } main {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args void solve() throws IOException{
        long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
        long t = n/(a+b);
        long r = n%(a+b);
        long ans = t*a+Math.min(r,a);
        System.out.println(ans);
    } solve {
        long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
        long t = n/(a+b);
        long r = n%(a+b);
        long ans = t*a+Math.min(r,a);
        System.out.println(ans);
    } long n = sc.nextLong() n sc.nextLong() sc.nextLong sc a = sc.nextLong() a sc.nextLong() sc.nextLong sc b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long t = n/(a+b); t n/(a+b) n (a+b) a b long r = n%(a+b); r n%(a+b) n (a+b) a b long ans = t*a+Math.min(r,a); ans t*a+Math.min(r,a) t*a t a Math.min(r,a) Math.min Math r a System.out.println(ans) System.out.println System.out System System.out ans public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int k;
    long[] d;
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException{
        long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
        long t = n/(a+b);
        long r = n%(a+b);
        long ans = t*a+Math.min(r,a);
        System.out.println(ans);
    }
} public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int k;
    long[] d;
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException{
        long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
        long t = n/(a+b);
        long r = n%(a+b);
        long ans = t*a+Math.min(r,a);
        System.out.println(ans);
    }
} Main
import java.io.*;
import java.util.*;

public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    int k;
    long[] d;
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException{
        long n = sc.nextLong(), a = sc.nextLong(), b = sc.nextLong();
        long t = n/(a+b);
        long r = n%(a+b);
        long ans = t*a+Math.min(r,a);
        System.out.println(ans);
    }
}

