
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(),A= sc.nextLong(),B= sc.nextLong();
		long wa =A+B;
		if(wa==0) {
			System.out.println(0);
		}else {
			long ans = (N/wa)*A;
			if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= A;
			}
			System.out.println(ans);
		}
	}

} 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(),A= sc.nextLong(),B= sc.nextLong();
		long wa =A+B;
		if(wa==0) {
			System.out.println(0);
		}else {
			long ans = (N/wa)*A;
			if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= A;
			}
			System.out.println(ans);
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(),A= sc.nextLong(),B= sc.nextLong();
		long wa =A+B;
		if(wa==0) {
			System.out.println(0);
		}else {
			long ans = (N/wa)*A;
			if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= A;
			}
			System.out.println(ans);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(),A= sc.nextLong(),B= sc.nextLong();
		long wa =A+B;
		if(wa==0) {
			System.out.println(0);
		}else {
			long ans = (N/wa)*A;
			if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= 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 A= sc.nextLong() A sc.nextLong() sc.nextLong sc B= sc.nextLong(); B sc.nextLong() sc.nextLong sc long wa =A+B; wa A+B A B if(wa==0) {
			System.out.println(0);
		}else {
			long ans = (N/wa)*A;
			if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= A;
			}
			System.out.println(ans);
		} wa==0 wa 0 {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 {
			long ans = (N/wa)*A;
			if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= A;
			}
			System.out.println(ans);
		} long ans = (N/wa)*A; ans (N/wa)*A (N/wa) N wa A if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= A;
			} N%wa<=A N%wa N wa A {
				ans+= N%wa;
			} ans+= N%wa ans N%wa N wa {
				ans+= A;
			} ans+= A ans 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) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(),A= sc.nextLong(),B= sc.nextLong();
		long wa =A+B;
		if(wa==0) {
			System.out.println(0);
		}else {
			long ans = (N/wa)*A;
			if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= A;
			}
			System.out.println(ans);
		}
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(),A= sc.nextLong(),B= sc.nextLong();
		long wa =A+B;
		if(wa==0) {
			System.out.println(0);
		}else {
			long ans = (N/wa)*A;
			if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= A;
			}
			System.out.println(ans);
		}
	}

} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong(),A= sc.nextLong(),B= sc.nextLong();
		long wa =A+B;
		if(wa==0) {
			System.out.println(0);
		}else {
			long ans = (N/wa)*A;
			if (N%wa<=A) {
				ans+= N%wa;
			}else{
				ans+= A;
			}
			System.out.println(ans);
		}
	}

}