import java.util.Scanner;
 
public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    long N = scanner.nextLong();
    long A = scanner.nextLong();
    long B = scanner.nextLong();
    long answer = A * (N / (A+B));
    answer += Math.min(N % (A+B),A);//小さいほうの値を返す
    /*
    <上と同じ>
    if(N % (A+B) > A){
    	answer = answer + N % (A+B);
    }else{
    	answer = answer + A;
    }
    */
    System.out.println(answer);
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    long N = scanner.nextLong();
    long A = scanner.nextLong();
    long B = scanner.nextLong();
    long answer = A * (N / (A+B));
    answer += Math.min(N % (A+B),A);//小さいほうの値を返す
    /*
    <上と同じ>
    if(N % (A+B) > A){
    	answer = answer + N % (A+B);
    }else{
    	answer = answer + A;
    }
    */
    System.out.println(answer);
  }
} Main public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    long N = scanner.nextLong();
    long A = scanner.nextLong();
    long B = scanner.nextLong();
    long answer = A * (N / (A+B));
    answer += Math.min(N % (A+B),A);//小さいほうの値を返す
    /*
    <上と同じ>
    if(N % (A+B) > A){
    	answer = answer + N % (A+B);
    }else{
    	answer = answer + A;
    }
    */
    System.out.println(answer);
  } main {
    Scanner scanner = new Scanner(System.in);
    long N = scanner.nextLong();
    long A = scanner.nextLong();
    long B = scanner.nextLong();
    long answer = A * (N / (A+B));
    answer += Math.min(N % (A+B),A);//小さいほうの値を返す
    /*
    <上と同じ>
    if(N % (A+B) > A){
    	answer = answer + N % (A+B);
    }else{
    	answer = answer + A;
    }
    */
    System.out.println(answer);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long N = scanner.nextLong(); N scanner.nextLong() scanner.nextLong scanner long A = scanner.nextLong(); A scanner.nextLong() scanner.nextLong scanner long B = scanner.nextLong(); B scanner.nextLong() scanner.nextLong scanner long answer = A * (N / (A+B)); answer A * (N / (A+B)) A (N / (A+B)) N (A+B) A B answer += Math.min(N % (A+B),A) answer Math.min(N % (A+B),A) Math.min Math N % (A+B) N (A+B) A B A System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    long N = scanner.nextLong();
    long A = scanner.nextLong();
    long B = scanner.nextLong();
    long answer = A * (N / (A+B));
    answer += Math.min(N % (A+B),A);//小さいほうの値を返す
    /*
    <上と同じ>
    if(N % (A+B) > A){
    	answer = answer + N % (A+B);
    }else{
    	answer = answer + A;
    }
    */
    System.out.println(answer);
  }
} public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    long N = scanner.nextLong();
    long A = scanner.nextLong();
    long B = scanner.nextLong();
    long answer = A * (N / (A+B));
    answer += Math.min(N % (A+B),A);//小さいほうの値を返す
    /*
    <上と同じ>
    if(N % (A+B) > A){
    	answer = answer + N % (A+B);
    }else{
    	answer = answer + A;
    }
    */
    System.out.println(answer);
  }
} Main
import java.util.Scanner;
 
public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    long N = scanner.nextLong();
    long A = scanner.nextLong();
    long B = scanner.nextLong();
    long answer = A * (N / (A+B));
    answer += Math.min(N % (A+B),A);//小さいほうの値を返す
    /*
    <上と同じ>
    if(N % (A+B) > A){
    	answer = answer + N % (A+B);
    }else{
    	answer = answer + A;
    }
    */
    System.out.println(answer);
  }
}