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();
		sc.close();
		long s = N/(A+B)*A;
		long k = N%(A+B);
		s += Math.min(A,k);
		System.out.println(s);
	}

} 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();
		sc.close();
		long s = N/(A+B)*A;
		long k = N%(A+B);
		s += Math.min(A,k);
		System.out.println(s);
	}

} 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();
		sc.close();
		long s = N/(A+B)*A;
		long k = N%(A+B);
		s += Math.min(A,k);
		System.out.println(s);
	} main {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		sc.close();
		long s = N/(A+B)*A;
		long k = N%(A+B);
		s += Math.min(A,k);
		System.out.println(s);
	} 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 sc.close() sc.close sc long s = N/(A+B)*A; s N/(A+B)*A N/(A+B) N (A+B) A B A long k = N%(A+B); k N%(A+B) N (A+B) A B s += Math.min(A,k) s Math.min(A,k) Math.min Math A k System.out.println(s) System.out.println System.out System System.out s 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();
		sc.close();
		long s = N/(A+B)*A;
		long k = N%(A+B);
		s += Math.min(A,k);
		System.out.println(s);
	}

} 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();
		sc.close();
		long s = N/(A+B)*A;
		long k = N%(A+B);
		s += Math.min(A,k);
		System.out.println(s);
	}

} 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();
		sc.close();
		long s = N/(A+B)*A;
		long k = N%(A+B);
		s += Math.min(A,k);
		System.out.println(s);
	}

}