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 sum = a+b;
    long roop = n/sum;
    long ans = roop*a;
    if(n%sum != 0 && a != 0){
    	if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	}
    }
   System.out.println(ans);
  }
} 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 sum = a+b;
    long roop = n/sum;
    long ans = roop*a;
    if(n%sum != 0 && a != 0){
    	if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	}
    }
   System.out.println(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 sum = a+b;
    long roop = n/sum;
    long ans = roop*a;
    if(n%sum != 0 && a != 0){
    	if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	}
    }
   System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long sum = a+b;
    long roop = n/sum;
    long ans = roop*a;
    if(n%sum != 0 && a != 0){
    	if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	}
    }
   System.out.println(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 sum = a+b; sum a+b a b long roop = n/sum; roop n/sum n sum long ans = roop*a; ans roop*a roop a if(n%sum != 0 && a != 0){
    	if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	}
    } n%sum != 0 && a != 0 n%sum != 0 n%sum n sum 0 a != 0 a 0 {
    	if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	}
    } if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	} (n-sum*roop)<a (n-sum*roop) n sum*roop sum roop a {
    		ans +=n-sum*roop;
    	} ans +=n-sum*roop ans n-sum*roop n sum*roop sum roop {
    		ans += a;
    	} ans += a ans a System.out.println(ans) System.out.println 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 sum = a+b;
    long roop = n/sum;
    long ans = roop*a;
    if(n%sum != 0 && a != 0){
    	if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	}
    }
   System.out.println(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 sum = a+b;
    long roop = n/sum;
    long ans = roop*a;
    if(n%sum != 0 && a != 0){
    	if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	}
    }
   System.out.println(ans);
  }
} 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 sum = a+b;
    long roop = n/sum;
    long ans = roop*a;
    if(n%sum != 0 && a != 0){
    	if((n-sum*roop)<a) {
    		ans +=n-sum*roop;
    	}
    	else {
    		ans += a;
    	}
    }
   System.out.println(ans);
  }
}