import java.util.*;

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 ret = 0;
   long rep = (long)(n/(a+b));
   ret += rep*a;
   long remain = n - (rep*(a+b));
  
   System.out.println(ret+Math.max(0,Math.min(a,remain)));
}
} import java.util.*; util.* java 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 ret = 0;
   long rep = (long)(n/(a+b));
   ret += rep*a;
   long remain = n - (rep*(a+b));
  
   System.out.println(ret+Math.max(0,Math.min(a,remain)));
}
} 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 ret = 0;
   long rep = (long)(n/(a+b));
   ret += rep*a;
   long remain = n - (rep*(a+b));
  
   System.out.println(ret+Math.max(0,Math.min(a,remain)));
} main {
   Scanner sc = new Scanner(System.in);
   long n = sc.nextLong();
   long a = sc.nextLong();
   long b = sc.nextLong();
   long ret = 0;
   long rep = (long)(n/(a+b));
   ret += rep*a;
   long remain = n - (rep*(a+b));
  
   System.out.println(ret+Math.max(0,Math.min(a,remain)));
} 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 ret = 0; ret 0 long rep = (long)(n/(a+b)); rep (long)(n/(a+b)) n (a+b) a b ret += rep*a ret rep*a rep a long remain = n - (rep*(a+b)); remain n - (rep*(a+b)) n (rep*(a+b)) rep (a+b) a b System.out.println(ret+Math.max(0,Math.min(a,remain))) System.out.println System.out System System.out ret+Math.max(0,Math.min(a,remain)) ret Math.max(0,Math.min(a,remain)) Math.max Math 0 Math.min(a,remain) Math.min Math a remain String args[] args
import java.util.*;

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 ret = 0;
   long rep = (long)(n/(a+b));
   ret += rep*a;
   long remain = n - (rep*(a+b));
  
   System.out.println(ret+Math.max(0,Math.min(a,remain)));
}
}