import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n,a,b,ans;
		
		n=sc.nextLong();
		a=sc.nextLong();
		b=sc.nextLong();
		if(a + b != 0){
			ans=n/(a+b);
			n%=a+b;
			ans*=a;
			if (n<a){
				ans+=n;
			}else{
				ans+=a;
			}
		} else {
			ans=(long)0;
		}

		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n,a,b,ans;
		
		n=sc.nextLong();
		a=sc.nextLong();
		b=sc.nextLong();
		if(a + b != 0){
			ans=n/(a+b);
			n%=a+b;
			ans*=a;
			if (n<a){
				ans+=n;
			}else{
				ans+=a;
			}
		} else {
			ans=(long)0;
		}

		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n,a,b,ans;
		
		n=sc.nextLong();
		a=sc.nextLong();
		b=sc.nextLong();
		if(a + b != 0){
			ans=n/(a+b);
			n%=a+b;
			ans*=a;
			if (n<a){
				ans+=n;
			}else{
				ans+=a;
			}
		} else {
			ans=(long)0;
		}

		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		long n,a,b,ans;
		
		n=sc.nextLong();
		a=sc.nextLong();
		b=sc.nextLong();
		if(a + b != 0){
			ans=n/(a+b);
			n%=a+b;
			ans*=a;
			if (n<a){
				ans+=n;
			}else{
				ans+=a;
			}
		} else {
			ans=(long)0;
		}

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

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

		System.out.println(ans);
		sc.close();
	}
} Main
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n,a,b,ans;
		
		n=sc.nextLong();
		a=sc.nextLong();
		b=sc.nextLong();
		if(a + b != 0){
			ans=n/(a+b);
			n%=a+b;
			ans*=a;
			if (n<a){
				ans+=n;
			}else{
				ans+=a;
			}
		} else {
			ans=(long)0;
		}

		System.out.println(ans);
		sc.close();
	}
}