import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        long N = stdIn.nextLong();
        long A = stdIn.nextLong();
        long B = stdIn.nextLong();
        stdIn.close();
 
        long Count = 0;
 
        if (N % (A + B) > A) {
            Count = A * (N / (A + B)) + A;
        } else {
            Count = A * (N / (A + B)) + (N % (A + B));
        }
 
        System.out.println(Count);
    }
} import java.util.*; util.* java public class Main {
 
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        long N = stdIn.nextLong();
        long A = stdIn.nextLong();
        long B = stdIn.nextLong();
        stdIn.close();
 
        long Count = 0;
 
        if (N % (A + B) > A) {
            Count = A * (N / (A + B)) + A;
        } else {
            Count = A * (N / (A + B)) + (N % (A + B));
        }
 
        System.out.println(Count);
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        long N = stdIn.nextLong();
        long A = stdIn.nextLong();
        long B = stdIn.nextLong();
        stdIn.close();
 
        long Count = 0;
 
        if (N % (A + B) > A) {
            Count = A * (N / (A + B)) + A;
        } else {
            Count = A * (N / (A + B)) + (N % (A + B));
        }
 
        System.out.println(Count);
    } main {
        Scanner stdIn = new Scanner(System.in);
        long N = stdIn.nextLong();
        long A = stdIn.nextLong();
        long B = stdIn.nextLong();
        stdIn.close();
 
        long Count = 0;
 
        if (N % (A + B) > A) {
            Count = A * (N / (A + B)) + A;
        } else {
            Count = A * (N / (A + B)) + (N % (A + B));
        }
 
        System.out.println(Count);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) long N = stdIn.nextLong(); N stdIn.nextLong() stdIn.nextLong stdIn long A = stdIn.nextLong(); A stdIn.nextLong() stdIn.nextLong stdIn long B = stdIn.nextLong(); B stdIn.nextLong() stdIn.nextLong stdIn stdIn.close() stdIn.close stdIn long Count = 0; Count 0 if (N % (A + B) > A) {
            Count = A * (N / (A + B)) + A;
        } else {
            Count = A * (N / (A + B)) + (N % (A + B));
        } N % (A + B) > A N % (A + B) N (A + B) A B A {
            Count = A * (N / (A + B)) + A;
        } Count = A * (N / (A + B)) + A Count A * (N / (A + B)) + A A * (N / (A + B)) A (N / (A + B)) N (A + B) A B A {
            Count = A * (N / (A + B)) + (N % (A + B));
        } Count = A * (N / (A + B)) + (N % (A + B)) Count A * (N / (A + B)) + (N % (A + B)) A * (N / (A + B)) A (N / (A + B)) N (A + B) A B (N % (A + B)) N (A + B) A B System.out.println(Count) System.out.println System.out System System.out Count String[] args args public class Main {
 
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        long N = stdIn.nextLong();
        long A = stdIn.nextLong();
        long B = stdIn.nextLong();
        stdIn.close();
 
        long Count = 0;
 
        if (N % (A + B) > A) {
            Count = A * (N / (A + B)) + A;
        } else {
            Count = A * (N / (A + B)) + (N % (A + B));
        }
 
        System.out.println(Count);
    }
} public class Main {
 
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        long N = stdIn.nextLong();
        long A = stdIn.nextLong();
        long B = stdIn.nextLong();
        stdIn.close();
 
        long Count = 0;
 
        if (N % (A + B) > A) {
            Count = A * (N / (A + B)) + A;
        } else {
            Count = A * (N / (A + B)) + (N % (A + B));
        }
 
        System.out.println(Count);
    }
} Main
import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        long N = stdIn.nextLong();
        long A = stdIn.nextLong();
        long B = stdIn.nextLong();
        stdIn.close();
 
        long Count = 0;
 
        if (N % (A + B) > A) {
            Count = A * (N / (A + B)) + A;
        } else {
            Count = A * (N / (A + B)) + (N % (A + B));
        }
 
        System.out.println(Count);
    }
}