import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();

		long ab = a + b;
		long ans = n / ab * a;
		ans += Math.min(n % ab, a);
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();

		long ab = a + b;
		long ans = n / ab * a;
		ans += Math.min(n % ab, a);
		System.out.println(ans);
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();

		long ab = a + b;
		long ans = n / ab * a;
		ans += Math.min(n % ab, a);
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();

		long ab = a + b;
		long ans = n / ab * a;
		ans += Math.min(n % ab, a);
		System.out.println(ans);
	} 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 ab = a + b; ab a + b a b long ans = n / ab * a; ans n / ab * a n / ab n ab a ans += Math.min(n % ab, a) ans Math.min(n % ab, a) Math.min Math n % ab n ab a System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();

		long ab = a + b;
		long ans = n / ab * a;
		ans += Math.min(n % ab, a);
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();

		long ab = a + b;
		long ans = n / ab * a;
		ans += Math.min(n % ab, a);
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();

		long ab = a + b;
		long ans = n / ab * a;
		ans += Math.min(n % ab, a);
		System.out.println(ans);
	}
}
