import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();
        if(A==0){
            System.out.println(0);
            return;
        }
        long num = N/(A+B);
        long rem = N - num*(A+B);
        long remB = rem>=A?A:rem;
        System.out.println(num * A + remB);
    }

} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();
        if(A==0){
            System.out.println(0);
            return;
        }
        long num = N/(A+B);
        long rem = N - num*(A+B);
        long remB = rem>=A?A:rem;
        System.out.println(num * A + remB);
    }

} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();
        if(A==0){
            System.out.println(0);
            return;
        }
        long num = N/(A+B);
        long rem = N - num*(A+B);
        long remB = rem>=A?A:rem;
        System.out.println(num * A + remB);
    } main {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();
        if(A==0){
            System.out.println(0);
            return;
        }
        long num = N/(A+B);
        long rem = N - num*(A+B);
        long remB = rem>=A?A:rem;
        System.out.println(num * A + remB);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long N = scanner.nextLong(); N scanner.nextLong() scanner.nextLong scanner long A = scanner.nextLong(); A scanner.nextLong() scanner.nextLong scanner long B = scanner.nextLong(); B scanner.nextLong() scanner.nextLong scanner if(A==0){
            System.out.println(0);
            return;
        } A==0 A 0 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; long num = N/(A+B); num N/(A+B) N (A+B) A B long rem = N - num*(A+B); rem N - num*(A+B) N num*(A+B) num (A+B) A B long remB = rem>=A?A:rem; remB rem>=A?A:rem rem>=A rem A A rem System.out.println(num * A + remB) System.out.println System.out System System.out num * A + remB num * A num A remB String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();
        if(A==0){
            System.out.println(0);
            return;
        }
        long num = N/(A+B);
        long rem = N - num*(A+B);
        long remB = rem>=A?A:rem;
        System.out.println(num * A + remB);
    }

} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();
        if(A==0){
            System.out.println(0);
            return;
        }
        long num = N/(A+B);
        long rem = N - num*(A+B);
        long remB = rem>=A?A:rem;
        System.out.println(num * A + remB);
    }

} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();
        if(A==0){
            System.out.println(0);
            return;
        }
        long num = N/(A+B);
        long rem = N - num*(A+B);
        long remB = rem>=A?A:rem;
        System.out.println(num * A + remB);
    }

}
