import java.util.Scanner;
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 = n/(a+b);
    long d = n-(a+b)*c;
    System.out.println(c*a+Math.min(a,d));
    
    
  }
} import java.util.Scanner; Scanner 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();
    long c = n/(a+b);
    long d = n-(a+b)*c;
    System.out.println(c*a+Math.min(a,d));
    
    
  }
} 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 = n/(a+b);
    long d = n-(a+b)*c;
    System.out.println(c*a+Math.min(a,d));
    
    
  } main {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = n/(a+b);
    long d = n-(a+b)*c;
    System.out.println(c*a+Math.min(a,d));
    
    
  } 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 = n/(a+b); c n/(a+b) n (a+b) a b long d = n-(a+b)*c; d n-(a+b)*c n (a+b)*c (a+b) a b c System.out.println(c*a+Math.min(a,d)) System.out.println System.out System System.out c*a+Math.min(a,d) c*a c a Math.min(a,d) Math.min Math a d String[] args args
import java.util.Scanner;
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 = n/(a+b);
    long d = n-(a+b)*c;
    System.out.println(c*a+Math.min(a,d));
    
    
  }
}
