import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
      	long a = Long.parseLong(sc.next());
      	long b = Long.parseLong(sc.next());
      	if(a==0){
        	System.out.println(0);
          return;
        }
        long c = a+b;
      	long d = n%c;
      	if(d>a) d = a;
        long e = n/c;
        long f = e*a+d;
        System.out.println(f);
    }
 
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
      	long a = Long.parseLong(sc.next());
      	long b = Long.parseLong(sc.next());
      	if(a==0){
        	System.out.println(0);
          return;
        }
        long c = a+b;
      	long d = n%c;
      	if(d>a) d = a;
        long e = n/c;
        long f = e*a+d;
        System.out.println(f);
    }
 
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
      	long a = Long.parseLong(sc.next());
      	long b = Long.parseLong(sc.next());
      	if(a==0){
        	System.out.println(0);
          return;
        }
        long c = a+b;
      	long d = n%c;
      	if(d>a) d = a;
        long e = n/c;
        long f = e*a+d;
        System.out.println(f);
    } main {
    	Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
      	long a = Long.parseLong(sc.next());
      	long b = Long.parseLong(sc.next());
      	if(a==0){
        	System.out.println(0);
          return;
        }
        long c = a+b;
      	long d = n%c;
      	if(d>a) d = a;
        long e = n/c;
        long f = e*a+d;
        System.out.println(f);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = Long.parseLong(sc.next()); n Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long a = Long.parseLong(sc.next()); a Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long b = Long.parseLong(sc.next()); b Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc if(a==0){
        	System.out.println(0);
          return;
        } a==0 a 0 {
        	System.out.println(0);
          return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; long c = a+b; c a+b a b long d = n%c; d n%c n c if(d>a) d = a; d>a d a d = a d a long e = n/c; e n/c n c long f = e*a+d; f e*a+d e*a e a d System.out.println(f) System.out.println System.out System System.out f String[] args args public class Main{
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
      	long a = Long.parseLong(sc.next());
      	long b = Long.parseLong(sc.next());
      	if(a==0){
        	System.out.println(0);
          return;
        }
        long c = a+b;
      	long d = n%c;
      	if(d>a) d = a;
        long e = n/c;
        long f = e*a+d;
        System.out.println(f);
    }
 
} public class Main{
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
      	long a = Long.parseLong(sc.next());
      	long b = Long.parseLong(sc.next());
      	if(a==0){
        	System.out.println(0);
          return;
        }
        long c = a+b;
      	long d = n%c;
      	if(d>a) d = a;
        long e = n/c;
        long f = e*a+d;
        System.out.println(f);
    }
 
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		long n = Long.parseLong(sc.next());
      	long a = Long.parseLong(sc.next());
      	long b = Long.parseLong(sc.next());
      	if(a==0){
        	System.out.println(0);
          return;
        }
        long c = a+b;
      	long d = n%c;
      	if(d>a) d = a;
        long e = n/c;
        long f = e*a+d;
        System.out.println(f);
    }
 
}