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();

		if(A==0) {
			System.out.println(0);
			return;
		} else if(B==0) {
			System.out.println(N);
			return;
		}

		long J = N/(A+B);
		long K = N%(A+B) >= A ? A : N%(A+B);

		long result = (J*A) + K;
		System.out.println(result);
	}
} 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();

		if(A==0) {
			System.out.println(0);
			return;
		} else if(B==0) {
			System.out.println(N);
			return;
		}

		long J = N/(A+B);
		long K = N%(A+B) >= A ? A : N%(A+B);

		long result = (J*A) + K;
		System.out.println(result);
	}
} 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();

		if(A==0) {
			System.out.println(0);
			return;
		} else if(B==0) {
			System.out.println(N);
			return;
		}

		long J = N/(A+B);
		long K = N%(A+B) >= A ? A : N%(A+B);

		long result = (J*A) + K;
		System.out.println(result);
	} main {

		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();

		if(A==0) {
			System.out.println(0);
			return;
		} else if(B==0) {
			System.out.println(N);
			return;
		}

		long J = N/(A+B);
		long K = N%(A+B) >= A ? A : N%(A+B);

		long result = (J*A) + K;
		System.out.println(result);
	} 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 if(A==0) {
			System.out.println(0);
			return;
		} else if(B==0) {
			System.out.println(N);
			return;
		} A==0 A 0 {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; if(B==0) {
			System.out.println(N);
			return;
		} B==0 B 0 {
			System.out.println(N);
			return;
		} System.out.println(N) System.out.println System.out System System.out N return; long J = N/(A+B); J N/(A+B) N (A+B) A B long K = N%(A+B) >= A ? A : N%(A+B); K N%(A+B) >= A ? A : N%(A+B) N%(A+B) >= A N%(A+B) N (A+B) A B A A N%(A+B) N (A+B) A B long result = (J*A) + K; result (J*A) + K (J*A) J A K System.out.println(result) System.out.println System.out System System.out result 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();

		if(A==0) {
			System.out.println(0);
			return;
		} else if(B==0) {
			System.out.println(N);
			return;
		}

		long J = N/(A+B);
		long K = N%(A+B) >= A ? A : N%(A+B);

		long result = (J*A) + K;
		System.out.println(result);
	}
} 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();

		if(A==0) {
			System.out.println(0);
			return;
		} else if(B==0) {
			System.out.println(N);
			return;
		}

		long J = N/(A+B);
		long K = N%(A+B) >= A ? A : N%(A+B);

		long result = (J*A) + K;
		System.out.println(result);
	}
} 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();

		if(A==0) {
			System.out.println(0);
			return;
		} else if(B==0) {
			System.out.println(N);
			return;
		}

		long J = N/(A+B);
		long K = N%(A+B) >= A ? A : N%(A+B);

		long result = (J*A) + K;
		System.out.println(result);
	}
}