import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	long n,a,b,sum=0;
    n=sc.nextLong();
    a=sc.nextLong();
    b=sc.nextLong();
    
    sum=(n/(a+b))*a+((n%(a+b))>a?a:(n%(a+b)));
    System.out.print(sum);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	long n,a,b,sum=0;
    n=sc.nextLong();
    a=sc.nextLong();
    b=sc.nextLong();
    
    sum=(n/(a+b))*a+((n%(a+b))>a?a:(n%(a+b)));
    System.out.print(sum);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	long n,a,b,sum=0;
    n=sc.nextLong();
    a=sc.nextLong();
    b=sc.nextLong();
    
    sum=(n/(a+b))*a+((n%(a+b))>a?a:(n%(a+b)));
    System.out.print(sum);
  } main {
    Scanner sc = new Scanner(System.in);
  	long n,a,b,sum=0;
    n=sc.nextLong();
    a=sc.nextLong();
    b=sc.nextLong();
    
    sum=(n/(a+b))*a+((n%(a+b))>a?a:(n%(a+b)));
    System.out.print(sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n n a a b b sum=0; sum 0 n=sc.nextLong() n sc.nextLong() sc.nextLong sc a=sc.nextLong() a sc.nextLong() sc.nextLong sc b=sc.nextLong() b sc.nextLong() sc.nextLong sc sum=(n/(a+b))*a+((n%(a+b))>a?a:(n%(a+b))) sum (n/(a+b))*a+((n%(a+b))>a?a:(n%(a+b))) (n/(a+b))*a (n/(a+b)) n (a+b) a b a ((n%(a+b))>a?a:(n%(a+b))) (n%(a+b))>a (n%(a+b)) n (a+b) a b a a (n%(a+b)) n (a+b) a b System.out.print(sum) System.out.print System.out System System.out sum String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	long n,a,b,sum=0;
    n=sc.nextLong();
    a=sc.nextLong();
    b=sc.nextLong();
    
    sum=(n/(a+b))*a+((n%(a+b))>a?a:(n%(a+b)));
    System.out.print(sum);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	long n,a,b,sum=0;
    n=sc.nextLong();
    a=sc.nextLong();
    b=sc.nextLong();
    
    sum=(n/(a+b))*a+((n%(a+b))>a?a:(n%(a+b)));
    System.out.print(sum);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	long n,a,b,sum=0;
    n=sc.nextLong();
    a=sc.nextLong();
    b=sc.nextLong();
    
    sum=(n/(a+b))*a+((n%(a+b))>a?a:(n%(a+b)));
    System.out.print(sum);
  }
}