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 C = A+B;
    long ansA = A*(N/C);
    long ansB = Math.min(N%C, A); 
    System.out.println(ansA + ansB);
  }
} 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 C = A+B;
    long ansA = A*(N/C);
    long ansB = Math.min(N%C, A); 
    System.out.println(ansA + ansB);
  }
} 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 C = A+B;
    long ansA = A*(N/C);
    long ansB = Math.min(N%C, A); 
    System.out.println(ansA + ansB);
  } main {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();
    
    long C = A+B;
    long ansA = A*(N/C);
    long ansB = Math.min(N%C, A); 
    System.out.println(ansA + ansB);
  } 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 C = A+B; C A+B A B long ansA = A*(N/C); ansA A*(N/C) A (N/C) N C long ansB = Math.min(N%C, A); ansB Math.min(N%C, A) Math.min Math N%C N C A System.out.println(ansA + ansB) System.out.println System.out System System.out ansA + ansB ansA ansB 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 C = A+B;
    long ansA = A*(N/C);
    long ansB = Math.min(N%C, A); 
    System.out.println(ansA + ansB);
  }
} 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 C = A+B;
    long ansA = A*(N/C);
    long ansB = Math.min(N%C, A); 
    System.out.println(ansA + ansB);
  }
} 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 C = A+B;
    long ansA = A*(N/C);
    long ansB = Math.min(N%C, A); 
    System.out.println(ansA + ansB);
  }
}