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 amari = N%(A+B);
  	long ans=0;
  	if(A==0){
      System.out.print("0");
      System.exit(0);
    }
     
  	ans = A * (N/(A+B));
  	if(amari<=A){
     ans += amari; 
    }else{
      ans += A;
    }
  
	System.out.print(ans);
	}
} 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 amari = N%(A+B);
  	long ans=0;
  	if(A==0){
      System.out.print("0");
      System.exit(0);
    }
     
  	ans = A * (N/(A+B));
  	if(amari<=A){
     ans += amari; 
    }else{
      ans += A;
    }
  
	System.out.print(ans);
	}
} 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 amari = N%(A+B);
  	long ans=0;
  	if(A==0){
      System.out.print("0");
      System.exit(0);
    }
     
  	ans = A * (N/(A+B));
  	if(amari<=A){
     ans += amari; 
    }else{
      ans += A;
    }
  
	System.out.print(ans);
	} main {
	Scanner sc = new Scanner(System.in);
	long N = sc.nextLong();
 	long A = sc.nextLong();
 	long B = sc.nextLong();
  	long amari = N%(A+B);
  	long ans=0;
  	if(A==0){
      System.out.print("0");
      System.exit(0);
    }
     
  	ans = A * (N/(A+B));
  	if(amari<=A){
     ans += amari; 
    }else{
      ans += A;
    }
  
	System.out.print(ans);
	} 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 amari = N%(A+B); amari N%(A+B) N (A+B) A B long ans=0; ans 0 if(A==0){
      System.out.print("0");
      System.exit(0);
    } A==0 A 0 {
      System.out.print("0");
      System.exit(0);
    } System.out.print("0") System.out.print System.out System System.out "0" System.exit(0) System.exit System 0 ans = A * (N/(A+B)) ans A * (N/(A+B)) A (N/(A+B)) N (A+B) A B if(amari<=A){
     ans += amari; 
    }else{
      ans += A;
    } amari<=A amari A {
     ans += amari; 
    } ans += amari ans amari {
      ans += A;
    } ans += A ans A System.out.print(ans) System.out.print System.out System System.out ans 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 amari = N%(A+B);
  	long ans=0;
  	if(A==0){
      System.out.print("0");
      System.exit(0);
    }
     
  	ans = A * (N/(A+B));
  	if(amari<=A){
     ans += amari; 
    }else{
      ans += A;
    }
  
	System.out.print(ans);
	}
} 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 amari = N%(A+B);
  	long ans=0;
  	if(A==0){
      System.out.print("0");
      System.exit(0);
    }
     
  	ans = A * (N/(A+B));
  	if(amari<=A){
     ans += amari; 
    }else{
      ans += A;
    }
  
	System.out.print(ans);
	}
} 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 amari = N%(A+B);
  	long ans=0;
  	if(A==0){
      System.out.print("0");
      System.exit(0);
    }
     
  	ans = A * (N/(A+B));
  	if(amari<=A){
     ans += amari; 
    }else{
      ans += A;
    }
  
	System.out.print(ans);
	}
}