import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long ans = a * (n / (a+b));
        n %= (a+b);
        if(n >= a){
            System.out.println(ans+a);
        }else{
            System.out.println(ans+n);
        }
        
    }
}
  import java.util.*; util.* java import java.io.*; io.* java import java.math.*; math.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long ans = a * (n / (a+b));
        n %= (a+b);
        if(n >= a){
            System.out.println(ans+a);
        }else{
            System.out.println(ans+n);
        }
        
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long ans = a * (n / (a+b));
        n %= (a+b);
        if(n >= a){
            System.out.println(ans+a);
        }else{
            System.out.println(ans+n);
        }
        
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long ans = a * (n / (a+b));
        n %= (a+b);
        if(n >= a){
            System.out.println(ans+a);
        }else{
            System.out.println(ans+n);
        }
        
    } 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 ans = a * (n / (a+b)); ans a * (n / (a+b)) a (n / (a+b)) n (a+b) a b n %= (a+b) n (a+b) a b if(n >= a){
            System.out.println(ans+a);
        }else{
            System.out.println(ans+n);
        } n >= a n a {
            System.out.println(ans+a);
        } System.out.println(ans+a) System.out.println System.out System System.out ans+a ans a {
            System.out.println(ans+n);
        } System.out.println(ans+n) System.out.println System.out System System.out ans+n ans n String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long ans = a * (n / (a+b));
        n %= (a+b);
        if(n >= a){
            System.out.println(ans+a);
        }else{
            System.out.println(ans+n);
        }
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long ans = a * (n / (a+b));
        n %= (a+b);
        if(n >= a){
            System.out.println(ans+a);
        }else{
            System.out.println(ans+n);
        }
        
    }
} Main
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long ans = a * (n / (a+b));
        n %= (a+b);
        if(n >= a){
            System.out.println(ans+a);
        }else{
            System.out.println(ans+n);
        }
        
    }
}
 