import java.util.Scanner;

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

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