import java.util.Scanner;
public class Main {
  
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		long ans = (n/(a+b))*a;
		
		long rem = n % (a+b);
		
		System.out.println(ans+Math.min(a,rem));
		
	}

} import java.util.Scanner; Scanner java.util public class Main {
  
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		long ans = (n/(a+b))*a;
		
		long rem = n % (a+b);
		
		System.out.println(ans+Math.min(a,rem));
		
	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		long ans = (n/(a+b))*a;
		
		long rem = n % (a+b);
		
		System.out.println(ans+Math.min(a,rem));
		
	} main {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		long ans = (n/(a+b))*a;
		
		long rem = n % (a+b);
		
		System.out.println(ans+Math.min(a,rem));
		
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) long n = stdIn.nextLong(); n stdIn.nextLong() stdIn.nextLong stdIn long a = stdIn.nextLong(); a stdIn.nextLong() stdIn.nextLong stdIn long b = stdIn.nextLong(); b stdIn.nextLong() stdIn.nextLong stdIn long c = a + b; c a + b a b long cnt = n / c; cnt n / c n c long ans = (n/(a+b))*a; ans (n/(a+b))*a (n/(a+b)) n (a+b) a b a long rem = n % (a+b); rem n % (a+b) n (a+b) a b System.out.println(ans+Math.min(a,rem)) System.out.println System.out System System.out ans+Math.min(a,rem) ans Math.min(a,rem) Math.min Math a rem String[] args args public class Main {
  
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		long ans = (n/(a+b))*a;
		
		long rem = n % (a+b);
		
		System.out.println(ans+Math.min(a,rem));
		
	}

} public class Main {
  
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		long ans = (n/(a+b))*a;
		
		long rem = n % (a+b);
		
		System.out.println(ans+Math.min(a,rem));
		
	}

} Main
import java.util.Scanner;
public class Main {
  
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		long a = stdIn.nextLong();
		long b = stdIn.nextLong();
		
		long c = a + b;
		
		long cnt = n / c;
		
		long ans = (n/(a+b))*a;
		
		long rem = n % (a+b);
		
		System.out.println(ans+Math.min(a,rem));
		
	}

}