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();
        
    if(a>n){
      System.out.println(n);
      return;
    }
    
    long o = n/(a+b);
    o = o*a;
    long nokori = n % (a+b);

    
    if(nokori >=a)
      o += a;
    else
      o += nokori;
      
    System.out.println(o);
  }
} 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();
        
    if(a>n){
      System.out.println(n);
      return;
    }
    
    long o = n/(a+b);
    o = o*a;
    long nokori = n % (a+b);

    
    if(nokori >=a)
      o += a;
    else
      o += nokori;
      
    System.out.println(o);
  }
} 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();
        
    if(a>n){
      System.out.println(n);
      return;
    }
    
    long o = n/(a+b);
    o = o*a;
    long nokori = n % (a+b);

    
    if(nokori >=a)
      o += a;
    else
      o += nokori;
      
    System.out.println(o);
  } main {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
        
    if(a>n){
      System.out.println(n);
      return;
    }
    
    long o = n/(a+b);
    o = o*a;
    long nokori = n % (a+b);

    
    if(nokori >=a)
      o += a;
    else
      o += nokori;
      
    System.out.println(o);
  } 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 if(a>n){
      System.out.println(n);
      return;
    } a>n a n {
      System.out.println(n);
      return;
    } System.out.println(n) System.out.println System.out System System.out n return; long o = n/(a+b); o n/(a+b) n (a+b) a b o = o*a o o*a o a long nokori = n % (a+b); nokori n % (a+b) n (a+b) a b if(nokori >=a)
      o += a;
    else
      o += nokori; nokori >=a nokori a o += a o a o += nokori o nokori System.out.println(o) System.out.println System.out System System.out o 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();
        
    if(a>n){
      System.out.println(n);
      return;
    }
    
    long o = n/(a+b);
    o = o*a;
    long nokori = n % (a+b);

    
    if(nokori >=a)
      o += a;
    else
      o += nokori;
      
    System.out.println(o);
  }
}