
import java.util.*;

// "static void main" must be defined in a public class.
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        if(A + B == 0){
            System.out.println(0);
        }
        long sum = N / (A + B) * A + Math.min(N % (A + B), A);
        System.out.println(sum);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        if(A + B == 0){
            System.out.println(0);
        }
        long sum = N / (A + B) * A + Math.min(N % (A + B), A);
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        if(A + B == 0){
            System.out.println(0);
        }
        long sum = N / (A + B) * A + Math.min(N % (A + B), A);
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        if(A + B == 0){
            System.out.println(0);
        }
        long sum = N / (A + B) * A + Math.min(N % (A + B), A);
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc long B = sc.nextLong(); B sc.nextLong() sc.nextLong sc if(A + B == 0){
            System.out.println(0);
        } A + B == 0 A + B A B 0 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 long sum = N / (A + B) * A + Math.min(N % (A + B), A); sum N / (A + B) * A + Math.min(N % (A + B), A) N / (A + B) * A N / (A + B) N (A + B) A B A Math.min(N % (A + B), A) Math.min Math N % (A + B) N (A + B) A B A System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        if(A + B == 0){
            System.out.println(0);
        }
        long sum = N / (A + B) * A + Math.min(N % (A + B), A);
        System.out.println(sum);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        if(A + B == 0){
            System.out.println(0);
        }
        long sum = N / (A + B) * A + Math.min(N % (A + B), A);
        System.out.println(sum);
    }
} Main

import java.util.*;

// "static void main" must be defined in a public class.
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        if(A + B == 0){
            System.out.println(0);
        }
        long sum = N / (A + B) * A + Math.min(N % (A + B), A);
        System.out.println(sum);
    }
}
