import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        long C = A + B;
        // Nを指定した場合のあまり
        long L = N % C;
        // 計算用
        long target = A * (N / C) + Math.min(L, A);
        // 出力
        System.out.println(target);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        long C = A + B;
        // Nを指定した場合のあまり
        long L = N % C;
        // 計算用
        long target = A * (N / C) + Math.min(L, A);
        // 出力
        System.out.println(target);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        long C = A + B;
        // Nを指定した場合のあまり
        long L = N % C;
        // 計算用
        long target = A * (N / C) + Math.min(L, A);
        // 出力
        System.out.println(target);
    } main {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        long C = A + B;
        // Nを指定した場合のあまり
        long L = N % C;
        // 計算用
        long target = A * (N / C) + Math.min(L, A);
        // 出力
        System.out.println(target);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = Long.parseLong(sc.next()); N Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long A = Long.parseLong(sc.next()); A Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long B = Long.parseLong(sc.next()); B Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long C = A + B; C A + B A B long L = N % C; L N % C N C long target = A * (N / C) + Math.min(L, A); target A * (N / C) + Math.min(L, A) A * (N / C) A (N / C) N C Math.min(L, A) Math.min Math L A System.out.println(target) System.out.println System.out System System.out target String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        long C = A + B;
        // Nを指定した場合のあまり
        long L = N % C;
        // 計算用
        long target = A * (N / C) + Math.min(L, A);
        // 出力
        System.out.println(target);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        long C = A + B;
        // Nを指定した場合のあまり
        long L = N % C;
        // 計算用
        long target = A * (N / C) + Math.min(L, A);
        // 出力
        System.out.println(target);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = Long.parseLong(sc.next());
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
        long C = A + B;
        // Nを指定した場合のあまり
        long L = N % C;
        // 計算用
        long target = A * (N / C) + Math.min(L, A);
        // 出力
        System.out.println(target);
    }
}