import 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 k = n/(a+b);
    
    if(a==0){
    System.out.print("0");
    }else if(n%(a+b)<=a){
    System.out.println(a*k+n%(a+b));
    }else{
    System.out.println(a*k+a);
}
}
} 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();
    long k = n/(a+b);
    
    if(a==0){
    System.out.print("0");
    }else if(n%(a+b)<=a){
    System.out.println(a*k+n%(a+b));
    }else{
    System.out.println(a*k+a);
}
}
} 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 k = n/(a+b);
    
    if(a==0){
    System.out.print("0");
    }else if(n%(a+b)<=a){
    System.out.println(a*k+n%(a+b));
    }else{
    System.out.println(a*k+a);
}
} main {
    
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long k = n/(a+b);
    
    if(a==0){
    System.out.print("0");
    }else if(n%(a+b)<=a){
    System.out.println(a*k+n%(a+b));
    }else{
    System.out.println(a*k+a);
}
} 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 k = n/(a+b); k n/(a+b) n (a+b) a b if(a==0){
    System.out.print("0");
    }else if(n%(a+b)<=a){
    System.out.println(a*k+n%(a+b));
    }else{
    System.out.println(a*k+a);
} a==0 a 0 {
    System.out.print("0");
    } System.out.print("0") System.out.print System.out System System.out "0" if(n%(a+b)<=a){
    System.out.println(a*k+n%(a+b));
    }else{
    System.out.println(a*k+a);
} n%(a+b)<=a n%(a+b) n (a+b) a b a {
    System.out.println(a*k+n%(a+b));
    } System.out.println(a*k+n%(a+b)) System.out.println System.out System System.out a*k+n%(a+b) a*k a k n%(a+b) n (a+b) a b {
    System.out.println(a*k+a);
} System.out.println(a*k+a) System.out.println System.out System System.out a*k+a a*k a k a 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 k = n/(a+b);
    
    if(a==0){
    System.out.print("0");
    }else if(n%(a+b)<=a){
    System.out.println(a*k+n%(a+b));
    }else{
    System.out.println(a*k+a);
}
}
} 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 k = n/(a+b);
    
    if(a==0){
    System.out.print("0");
    }else if(n%(a+b)<=a){
    System.out.println(a*k+n%(a+b));
    }else{
    System.out.println(a*k+a);
}
}
} Main
import 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 k = n/(a+b);
    
    if(a==0){
    System.out.print("0");
    }else if(n%(a+b)<=a){
    System.out.println(a*k+n%(a+b));
    }else{
    System.out.println(a*k+a);
}
}
}