import java.io.*;
import java.util.*;
import java.util.ArrayList;
 
class Main
{
  public static void main (String[] arg)
  {
    Scanner scan = new Scanner(System.in);
    
    long N = scan.nextLong(); //整数    
    long A = scan.nextLong(); //整数    蒼
    long B = scan.nextLong(); //整数　　赤
    
    long ans = 0;
    
    if(A == 0){
      System.out.println(0);
    }
    
    else{
      
      ans = (N / (A + B)) * A;
      
      if((N % (A + B)) >= A){
        ans = ans + A;
      }
      else{
        
        ans = ans + N % (A + B);
      }
      System.out.println(ans);
    }
  }
} import java.io.*; io.* java import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util class Main
{
  public static void main (String[] arg)
  {
    Scanner scan = new Scanner(System.in);
    
    long N = scan.nextLong(); //整数    
    long A = scan.nextLong(); //整数    蒼
    long B = scan.nextLong(); //整数　　赤
    
    long ans = 0;
    
    if(A == 0){
      System.out.println(0);
    }
    
    else{
      
      ans = (N / (A + B)) * A;
      
      if((N % (A + B)) >= A){
        ans = ans + A;
      }
      else{
        
        ans = ans + N % (A + B);
      }
      System.out.println(ans);
    }
  }
} Main public static void main (String[] arg)
  {
    Scanner scan = new Scanner(System.in);
    
    long N = scan.nextLong(); //整数    
    long A = scan.nextLong(); //整数    蒼
    long B = scan.nextLong(); //整数　　赤
    
    long ans = 0;
    
    if(A == 0){
      System.out.println(0);
    }
    
    else{
      
      ans = (N / (A + B)) * A;
      
      if((N % (A + B)) >= A){
        ans = ans + A;
      }
      else{
        
        ans = ans + N % (A + B);
      }
      System.out.println(ans);
    }
  } main {
    Scanner scan = new Scanner(System.in);
    
    long N = scan.nextLong(); //整数    
    long A = scan.nextLong(); //整数    蒼
    long B = scan.nextLong(); //整数　　赤
    
    long ans = 0;
    
    if(A == 0){
      System.out.println(0);
    }
    
    else{
      
      ans = (N / (A + B)) * A;
      
      if((N % (A + B)) >= A){
        ans = ans + A;
      }
      else{
        
        ans = ans + N % (A + B);
      }
      System.out.println(ans);
    }
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long N = scan.nextLong(); N scan.nextLong() scan.nextLong scan long A = scan.nextLong(); A scan.nextLong() scan.nextLong scan long B = scan.nextLong(); B scan.nextLong() scan.nextLong scan long ans = 0; ans 0 if(A == 0){
      System.out.println(0);
    }
    
    else{
      
      ans = (N / (A + B)) * A;
      
      if((N % (A + B)) >= A){
        ans = ans + A;
      }
      else{
        
        ans = ans + N % (A + B);
      }
      System.out.println(ans);
    } A == 0 A 0 {
      System.out.println(0);
    } System.out.println(0) System.out.println System.out System System.out 0 {
      
      ans = (N / (A + B)) * A;
      
      if((N % (A + B)) >= A){
        ans = ans + A;
      }
      else{
        
        ans = ans + N % (A + B);
      }
      System.out.println(ans);
    } ans = (N / (A + B)) * A ans (N / (A + B)) * A (N / (A + B)) N (A + B) A B A if((N % (A + B)) >= A){
        ans = ans + A;
      }
      else{
        
        ans = ans + N % (A + B);
      } (N % (A + B)) >= A (N % (A + B)) N (A + B) A B A {
        ans = ans + A;
      } ans = ans + A ans ans + A ans A {
        
        ans = ans + N % (A + B);
      } ans = ans + N % (A + B) ans ans + N % (A + B) ans N % (A + B) N (A + B) A B System.out.println(ans) System.out.println System.out System System.out ans String[] arg arg
import java.io.*;
import java.util.*;
import java.util.ArrayList;
 
class Main
{
  public static void main (String[] arg)
  {
    Scanner scan = new Scanner(System.in);
    
    long N = scan.nextLong(); //整数    
    long A = scan.nextLong(); //整数    蒼
    long B = scan.nextLong(); //整数　　赤
    
    long ans = 0;
    
    if(A == 0){
      System.out.println(0);
    }
    
    else{
      
      ans = (N / (A + B)) * A;
      
      if((N % (A + B)) >= A){
        ans = ans + A;
      }
      else{
        
        ans = ans + N % (A + B);
      }
      System.out.println(ans);
    }
  }
}
