import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
		sc.close();
		
		long block = A + B;
		long loop = N / block;
		long rest = N % block;
		if(A <= rest) {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		}else {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
		sc.close();
		
		long block = A + B;
		long loop = N / block;
		long rest = N % block;
		if(A <= rest) {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		}else {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
		sc.close();
		
		long block = A + B;
		long loop = N / block;
		long rest = N % block;
		if(A <= rest) {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		}else {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		}
	} main {
		Scanner sc = new Scanner(System.in);
		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
		sc.close();
		
		long block = A + B;
		long loop = N / block;
		long rest = N % block;
		if(A <= rest) {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		}else {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = Long.parseLong(sc.next()); N Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long A = Long.parseLong(sc.next()); A Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long B = Long.parseLong(sc.next()); B Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc sc.close() sc.close sc long block = A + B; block A + B A B long loop = N / block; loop N / block N block long rest = N % block; rest N % block N block if(A <= rest) {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		}else {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		} A <= rest A rest {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		} long ans = loop * A + A; ans loop * A + A loop * A loop A A System.out.println(ans) System.out.println System.out System System.out ans return; {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		} long ans = loop * A + rest; ans loop * A + rest loop * A loop A rest System.out.println(ans) System.out.println System.out System System.out ans return; String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
		sc.close();
		
		long block = A + B;
		long loop = N / block;
		long rest = N % block;
		if(A <= rest) {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		}else {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
		sc.close();
		
		long block = A + B;
		long loop = N / block;
		long rest = N % block;
		if(A <= rest) {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		}else {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = Long.parseLong(sc.next());
		long A = Long.parseLong(sc.next());
		long B = Long.parseLong(sc.next());
		sc.close();
		
		long block = A + B;
		long loop = N / block;
		long rest = N % block;
		if(A <= rest) {
			long ans = loop * A + A;
			System.out.println(ans);
			return;
		}else {
			long ans = loop * A + rest;
			System.out.println(ans);
			return;
		}
	}
}