import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = n % (a + b);
        long out = 0;
        if(c <= a){
            out = c + (n / (a + b)) * a;
        }else{
            out = a + (n / (a + b)) * a; 
        }
        System.out.println(out);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = n % (a + b);
        long out = 0;
        if(c <= a){
            out = c + (n / (a + b)) * a;
        }else{
            out = a + (n / (a + b)) * a; 
        }
        System.out.println(out);
    }
} Main public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = n % (a + b);
        long out = 0;
        if(c <= a){
            out = c + (n / (a + b)) * a;
        }else{
            out = a + (n / (a + b)) * a; 
        }
        System.out.println(out);
    } main {
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = n % (a + b);
        long out = 0;
        if(c <= a){
            out = c + (n / (a + b)) * a;
        }else{
            out = a + (n / (a + b)) * a; 
        }
        System.out.println(out);
    } Scanner scan = new java.util.Scanner(System.in); scan new java.util.Scanner(System.in) long n = scan.nextLong(); n scan.nextLong() scan.nextLong scan long a = scan.nextLong(); a scan.nextLong() scan.nextLong scan long b = scan.nextLong(); b scan.nextLong() scan.nextLong scan long c = n % (a + b); c n % (a + b) n (a + b) a b long out = 0; out 0 if(c <= a){
            out = c + (n / (a + b)) * a;
        }else{
            out = a + (n / (a + b)) * a; 
        } c <= a c a {
            out = c + (n / (a + b)) * a;
        } out = c + (n / (a + b)) * a out c + (n / (a + b)) * a c (n / (a + b)) * a (n / (a + b)) n (a + b) a b a {
            out = a + (n / (a + b)) * a; 
        } out = a + (n / (a + b)) * a out a + (n / (a + b)) * a a (n / (a + b)) * a (n / (a + b)) n (a + b) a b a System.out.println(out) System.out.println System.out System System.out out String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = n % (a + b);
        long out = 0;
        if(c <= a){
            out = c + (n / (a + b)) * a;
        }else{
            out = a + (n / (a + b)) * a; 
        }
        System.out.println(out);
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = n % (a + b);
        long out = 0;
        if(c <= a){
            out = c + (n / (a + b)) * a;
        }else{
            out = a + (n / (a + b)) * a; 
        }
        System.out.println(out);
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long a = scan.nextLong();
        long b = scan.nextLong();
        long c = n % (a + b);
        long out = 0;
        if(c <= a){
            out = c + (n / (a + b)) * a;
        }else{
            out = a + (n / (a + b)) * a; 
        }
        System.out.println(out);
    }
}