import java.util.Scanner;

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();
    
        long answer = n / (a + b) * a;
        answer += Math.min(a, n % (a + b));
    
        System.out.println(answer);
    }

} import java.util.Scanner; Scanner java.util 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();
    
        long answer = n / (a + b) * a;
        answer += Math.min(a, n % (a + b));
    
        System.out.println(answer);
    }

} 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();
    
        long answer = n / (a + b) * a;
        answer += Math.min(a, n % (a + b));
    
        System.out.println(answer);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
    
        long answer = n / (a + b) * a;
        answer += Math.min(a, n % (a + b));
    
        System.out.println(answer);
    } 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 long answer = n / (a + b) * a; answer n / (a + b) * a n / (a + b) n (a + b) a b a answer += Math.min(a, n % (a + b)) answer Math.min(a, n % (a + b)) Math.min Math a n % (a + b) n (a + b) a b System.out.println(answer) System.out.println System.out System System.out answer 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();
    
        long answer = n / (a + b) * a;
        answer += Math.min(a, n % (a + b));
    
        System.out.println(answer);
    }

} 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();
    
        long answer = n / (a + b) * a;
        answer += Math.min(a, n % (a + b));
    
        System.out.println(answer);
    }

} Main
import java.util.Scanner;

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();
    
        long answer = n / (a + b) * a;
        answer += Math.min(a, n % (a + b));
    
        System.out.println(answer);
    }

}