import java.util.Scanner;

class Solver {
    public void Solve() {
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b + r;
        long ans = 0;
        if (b == 0) {
            System.out.println(0);
            return;
        }
        ans += n / sum * b;
        if (n % sum != 0) {
            long res = (n - (n / sum) * sum);
            ans += Math.min(res, b);
        }
        System.out.println(ans);
    }

    Scanner sc;

    Solver(Scanner in) {
        this.sc = in;
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
} import java.util.Scanner; Scanner java.util class Solver {
    public void Solve() {
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b + r;
        long ans = 0;
        if (b == 0) {
            System.out.println(0);
            return;
        }
        ans += n / sum * b;
        if (n % sum != 0) {
            long res = (n - (n / sum) * sum);
            ans += Math.min(res, b);
        }
        System.out.println(ans);
    }

    Scanner sc;

    Solver(Scanner in) {
        this.sc = in;
    }
} Solver Scanner sc; sc public void Solve() {
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b + r;
        long ans = 0;
        if (b == 0) {
            System.out.println(0);
            return;
        }
        ans += n / sum * b;
        if (n % sum != 0) {
            long res = (n - (n / sum) * sum);
            ans += Math.min(res, b);
        }
        System.out.println(ans);
    } Solve {
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b + r;
        long ans = 0;
        if (b == 0) {
            System.out.println(0);
            return;
        }
        ans += n / sum * b;
        if (n % sum != 0) {
            long res = (n - (n / sum) * sum);
            ans += Math.min(res, b);
        }
        System.out.println(ans);
    } long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long r = sc.nextLong(); r sc.nextLong() sc.nextLong sc long sum = b + r; sum b + r b r long ans = 0; ans 0 if (b == 0) {
            System.out.println(0);
            return;
        } b == 0 b 0 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; ans += n / sum * b ans n / sum * b n / sum n sum b if (n % sum != 0) {
            long res = (n - (n / sum) * sum);
            ans += Math.min(res, b);
        } n % sum != 0 n % sum n sum 0 {
            long res = (n - (n / sum) * sum);
            ans += Math.min(res, b);
        } long res = (n - (n / sum) * sum); res (n - (n / sum) * sum) n (n / sum) * sum (n / sum) n sum sum ans += Math.min(res, b) ans Math.min(res, b) Math.min Math res b System.out.println(ans) System.out.println System.out System System.out ans Solver(Scanner in) {
        this.sc = in;
    } Solver {
        this.sc = in;
    } this.sc = in this.sc this this.sc in Scanner in in public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Solver s = new Solver(sc); s new Solver(sc) s.Solve() s.Solve s sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
} Main
import java.util.Scanner;

class Solver {
    public void Solve() {
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b + r;
        long ans = 0;
        if (b == 0) {
            System.out.println(0);
            return;
        }
        ans += n / sum * b;
        if (n % sum != 0) {
            long res = (n - (n / sum) * sum);
            ans += Math.min(res, b);
        }
        System.out.println(ans);
    }

    Scanner sc;

    Solver(Scanner in) {
        this.sc = in;
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
}
