import java.util.Scanner;

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 p = A + B;
		
		if(N%p <= A) {
			System.out.println(N/p*A + N%p);
		}else {
			System.out.println(N/p*A + A);
		}


	}
} import java.util.Scanner; Scanner java.util 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 p = A + B;
		
		if(N%p <= A) {
			System.out.println(N/p*A + N%p);
		}else {
			System.out.println(N/p*A + A);
		}


	}
} 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 p = A + B;
		
		if(N%p <= A) {
			System.out.println(N/p*A + N%p);
		}else {
			System.out.println(N/p*A + A);
		}


	} main {
		Scanner sc = new Scanner(System.in);
		long  N = sc.nextLong();
		long  A = sc.nextLong();
		long  B = sc.nextLong();
		long p = A + B;
		
		if(N%p <= A) {
			System.out.println(N/p*A + N%p);
		}else {
			System.out.println(N/p*A + A);
		}


	} 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 p = A + B; p A + B A B if(N%p <= A) {
			System.out.println(N/p*A + N%p);
		}else {
			System.out.println(N/p*A + A);
		} N%p <= A N%p N p A {
			System.out.println(N/p*A + N%p);
		} System.out.println(N/p*A + N%p) System.out.println System.out System System.out N/p*A + N%p N/p*A N/p N p A N%p N p {
			System.out.println(N/p*A + A);
		} System.out.println(N/p*A + A) System.out.println System.out System System.out N/p*A + A N/p*A N/p N p A A String[] args args
import java.util.Scanner;

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 p = A + B;
		
		if(N%p <= A) {
			System.out.println(N/p*A + N%p);
		}else {
			System.out.println(N/p*A + A);
		}


	}
}
