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 roop = N / (A+B);
      long remain = N % (A+B);
      
      // 青いボールをカウント
      long result = A * roop;
      if(remain < A){
        result += remain;
      }else{
        result += A;
      }
        
      // 出力
      System.out.println(result);
    }
    
} 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 roop = N / (A+B);
      long remain = N % (A+B);
      
      // 青いボールをカウント
      long result = A * roop;
      if(remain < A){
        result += remain;
      }else{
        result += A;
      }
        
      // 出力
      System.out.println(result);
    }
    
} 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 roop = N / (A+B);
      long remain = N % (A+B);
      
      // 青いボールをカウント
      long result = A * roop;
      if(remain < A){
        result += remain;
      }else{
        result += A;
      }
        
      // 出力
      System.out.println(result);
    } main {
      // 入力
      Scanner sc = new Scanner(System.in);
      long N = sc.nextLong();
      long A = sc.nextLong();
      long B = sc.nextLong();
      
      // 周期数と余りをカウント
      long roop = N / (A+B);
      long remain = N % (A+B);
      
      // 青いボールをカウント
      long result = A * roop;
      if(remain < A){
        result += remain;
      }else{
        result += A;
      }
        
      // 出力
      System.out.println(result);
    } 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 roop = N / (A+B); roop N / (A+B) N (A+B) A B long remain = N % (A+B); remain N % (A+B) N (A+B) A B long result = A * roop; result A * roop A roop if(remain < A){
        result += remain;
      }else{
        result += A;
      } remain < A remain A {
        result += remain;
      } result += remain result remain {
        result += A;
      } result += A result A System.out.println(result) System.out.println System.out System System.out result 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 roop = N / (A+B);
      long remain = N % (A+B);
      
      // 青いボールをカウント
      long result = A * roop;
      if(remain < A){
        result += remain;
      }else{
        result += A;
      }
        
      // 出力
      System.out.println(result);
    }
    
} 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 roop = N / (A+B);
      long remain = N % (A+B);
      
      // 青いボールをカウント
      long result = A * roop;
      if(remain < A){
        result += remain;
      }else{
        result += A;
      }
        
      // 出力
      System.out.println(result);
    }
    
} 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 roop = N / (A+B);
      long remain = N % (A+B);
      
      // 青いボールをカウント
      long result = A * roop;
      if(remain < A){
        result += remain;
      }else{
        result += A;
      }
        
      // 出力
      System.out.println(result);
    }
    
}