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 setCnt = N/(A+B);
    long r = N%(A+B);
    long br = Math.min(r,A);
    System.out.println(br+setCnt*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 setCnt = N/(A+B);
    long r = N%(A+B);
    long br = Math.min(r,A);
    System.out.println(br+setCnt*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 setCnt = N/(A+B);
    long r = N%(A+B);
    long br = Math.min(r,A);
    System.out.println(br+setCnt*A);
  } main {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();
    long setCnt = N/(A+B);
    long r = N%(A+B);
    long br = Math.min(r,A);
    System.out.println(br+setCnt*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 setCnt = N/(A+B); setCnt N/(A+B) N (A+B) A B long r = N%(A+B); r N%(A+B) N (A+B) A B long br = Math.min(r,A); br Math.min(r,A) Math.min Math r A System.out.println(br+setCnt*A) System.out.println System.out System System.out br+setCnt*A br setCnt*A setCnt 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 setCnt = N/(A+B);
    long r = N%(A+B);
    long br = Math.min(r,A);
    System.out.println(br+setCnt*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 setCnt = N/(A+B);
    long r = N%(A+B);
    long br = Math.min(r,A);
    System.out.println(br+setCnt*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 setCnt = N/(A+B);
    long r = N%(A+B);
    long br = Math.min(r,A);
    System.out.println(br+setCnt*A);
  }
  

  
}