import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		long N;
		long A;
		long B;
		long X;
		long mod;
		Scanner sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		X = N / (A + B);
		mod = N % (A + B);
		System.out.println(X * A + Math.min(mod, A));
		sc.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		long N;
		long A;
		long B;
		long X;
		long mod;
		Scanner sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		X = N / (A + B);
		mod = N % (A + B);
		System.out.println(X * A + Math.min(mod, A));
		sc.close();
	}

} Main public static void main(String[] args) {

		long N;
		long A;
		long B;
		long X;
		long mod;
		Scanner sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		X = N / (A + B);
		mod = N % (A + B);
		System.out.println(X * A + Math.min(mod, A));
		sc.close();
	} main {

		long N;
		long A;
		long B;
		long X;
		long mod;
		Scanner sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		X = N / (A + B);
		mod = N % (A + B);
		System.out.println(X * A + Math.min(mod, A));
		sc.close();
	} long N; N long A; A long B; B long X; X long mod; mod Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextLong() N sc.nextLong() sc.nextLong sc A = sc.nextLong() A sc.nextLong() sc.nextLong sc B = sc.nextLong() B sc.nextLong() sc.nextLong sc X = N / (A + B) X N / (A + B) N (A + B) A B mod = N % (A + B) mod N % (A + B) N (A + B) A B System.out.println(X * A + Math.min(mod, A)) System.out.println System.out System System.out X * A + Math.min(mod, A) X * A X A Math.min(mod, A) Math.min Math mod A sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {

		long N;
		long A;
		long B;
		long X;
		long mod;
		Scanner sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		X = N / (A + B);
		mod = N % (A + B);
		System.out.println(X * A + Math.min(mod, A));
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {

		long N;
		long A;
		long B;
		long X;
		long mod;
		Scanner sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		X = N / (A + B);
		mod = N % (A + B);
		System.out.println(X * A + Math.min(mod, A));
		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		long N;
		long A;
		long B;
		long X;
		long mod;
		Scanner sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		X = N / (A + B);
		mod = N % (A + B);
		System.out.println(X * A + Math.min(mod, A));
		sc.close();
	}

}