import java.util.Scanner;
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 C = N/(A+B);
    long D = N%(A+B);
    
    if(A==0){
      System.out.println(0);
    } else if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+A);
    }
  }
} import java.util.Scanner; Scanner 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 C = N/(A+B);
    long D = N%(A+B);
    
    if(A==0){
      System.out.println(0);
    } else if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+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 C = N/(A+B);
    long D = N%(A+B);
    
    if(A==0){
      System.out.println(0);
    } else if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+A);
    }
  } 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);
    
    if(A==0){
      System.out.println(0);
    } else if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+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 C = N/(A+B); C N/(A+B) N (A+B) A B long D = N%(A+B); D N%(A+B) N (A+B) A B if(A==0){
      System.out.println(0);
    } else if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+A);
    } A==0 A 0 {
      System.out.println(0);
    } System.out.println(0) System.out.println System.out System System.out 0 if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+A);
    } D<=A D A {
      System.out.println(C*A+D);
    } System.out.println(C*A+D) System.out.println System.out System System.out C*A+D C*A C A D if(D>A) {
      System.out.println(C*A+A);
    } D>A D A {
      System.out.println(C*A+A);
    } System.out.println(C*A+A) System.out.println System.out System System.out C*A+A C*A C A 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 C = N/(A+B);
    long D = N%(A+B);
    
    if(A==0){
      System.out.println(0);
    } else if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+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 C = N/(A+B);
    long D = N%(A+B);
    
    if(A==0){
      System.out.println(0);
    } else if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+A);
    }
  }
} Main
import java.util.Scanner;
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 C = N/(A+B);
    long D = N%(A+B);
    
    if(A==0){
      System.out.println(0);
    } else if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+A);
    }
  }
}