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 na1 = 0L;
		Long na2 = 0L;
		
		if ((N % (A+B)) <= A){
			na1 = (N / (A+B)) * A;
			na2 = N % (A+B);
		}else {
			na1 = (N / (A+B)) * A;
			na2 = A;
		}
		
		System.out.println(na1 + na2);
		sc.close();
	}
} 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 na1 = 0L;
		Long na2 = 0L;
		
		if ((N % (A+B)) <= A){
			na1 = (N / (A+B)) * A;
			na2 = N % (A+B);
		}else {
			na1 = (N / (A+B)) * A;
			na2 = A;
		}
		
		System.out.println(na1 + na2);
		sc.close();
	}
} 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 na1 = 0L;
		Long na2 = 0L;
		
		if ((N % (A+B)) <= A){
			na1 = (N / (A+B)) * A;
			na2 = N % (A+B);
		}else {
			na1 = (N / (A+B)) * A;
			na2 = A;
		}
		
		System.out.println(na1 + na2);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		Long N = sc.nextLong();
		Long A = sc.nextLong();
		Long B = sc.nextLong();

		Long na1 = 0L;
		Long na2 = 0L;
		
		if ((N % (A+B)) <= A){
			na1 = (N / (A+B)) * A;
			na2 = N % (A+B);
		}else {
			na1 = (N / (A+B)) * A;
			na2 = A;
		}
		
		System.out.println(na1 + na2);
		sc.close();
	} 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 na1 = 0L; na1 0L Long na2 = 0L; na2 0L if ((N % (A+B)) <= A){
			na1 = (N / (A+B)) * A;
			na2 = N % (A+B);
		}else {
			na1 = (N / (A+B)) * A;
			na2 = A;
		} (N % (A+B)) <= A (N % (A+B)) N (A+B) A B A {
			na1 = (N / (A+B)) * A;
			na2 = N % (A+B);
		} na1 = (N / (A+B)) * A na1 (N / (A+B)) * A (N / (A+B)) N (A+B) A B A na2 = N % (A+B) na2 N % (A+B) N (A+B) A B {
			na1 = (N / (A+B)) * A;
			na2 = A;
		} na1 = (N / (A+B)) * A na1 (N / (A+B)) * A (N / (A+B)) N (A+B) A B A na2 = A na2 A System.out.println(na1 + na2) System.out.println System.out System System.out na1 + na2 na1 na2 sc.close() sc.close sc 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 na1 = 0L;
		Long na2 = 0L;
		
		if ((N % (A+B)) <= A){
			na1 = (N / (A+B)) * A;
			na2 = N % (A+B);
		}else {
			na1 = (N / (A+B)) * A;
			na2 = A;
		}
		
		System.out.println(na1 + na2);
		sc.close();
	}
} 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 na1 = 0L;
		Long na2 = 0L;
		
		if ((N % (A+B)) <= A){
			na1 = (N / (A+B)) * A;
			na2 = N % (A+B);
		}else {
			na1 = (N / (A+B)) * A;
			na2 = A;
		}
		
		System.out.println(na1 + na2);
		sc.close();
	}
} 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 na1 = 0L;
		Long na2 = 0L;
		
		if ((N % (A+B)) <= A){
			na1 = (N / (A+B)) * A;
			na2 = N % (A+B);
		}else {
			na1 = (N / (A+B)) * A;
			na2 = A;
		}
		
		System.out.println(na1 + na2);
		sc.close();
	}
}