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 m =N/(A+B);
    long n=N%(A+B);
    if(n<A){System.out.println(m*A+n);}
    else{System.out.println((m+1)*A);}
  }
} 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 m =N/(A+B);
    long n=N%(A+B);
    if(n<A){System.out.println(m*A+n);}
    else{System.out.println((m+1)*A);}
  }
} 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 m =N/(A+B);
    long n=N%(A+B);
    if(n<A){System.out.println(m*A+n);}
    else{System.out.println((m+1)*A);}
  } main {
    Scanner sc=new Scanner(System.in);
    long N =sc.nextLong(); 
    long A =sc.nextLong();
    long B =sc.nextLong();
    long m =N/(A+B);
    long n=N%(A+B);
    if(n<A){System.out.println(m*A+n);}
    else{System.out.println((m+1)*A);}
  } 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 m =N/(A+B); m N/(A+B) N (A+B) A B long n=N%(A+B); n N%(A+B) N (A+B) A B if(n<A){System.out.println(m*A+n);}
    else{System.out.println((m+1)*A);} n<A n A {System.out.println(m*A+n);} System.out.println(m*A+n) System.out.println System.out System System.out m*A+n m*A m A n {System.out.println((m+1)*A);} System.out.println((m+1)*A) System.out.println System.out System System.out (m+1)*A (m+1) m 1 A 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 m =N/(A+B);
    long n=N%(A+B);
    if(n<A){System.out.println(m*A+n);}
    else{System.out.println((m+1)*A);}
  }
} 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 m =N/(A+B);
    long n=N%(A+B);
    if(n<A){System.out.println(m*A+n);}
    else{System.out.println((m+1)*A);}
  }
} 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 m =N/(A+B);
    long n=N%(A+B);
    if(n<A){System.out.println(m*A+n);}
    else{System.out.println((m+1)*A);}
  }
}