import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		long n=in.nextLong();
		long a=in.nextLong();
		long b=in.nextLong();
		long q=a+b;
		long m=0;
		if(n%q<=a)
		{
			m=n%q;
		}
		else
		{
			m=a;
		}
		System.out.println((n/q)*a+m);
	}
}
	 import java.util.*; util.* java import java.io.*; io.* java public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		long n=in.nextLong();
		long a=in.nextLong();
		long b=in.nextLong();
		long q=a+b;
		long m=0;
		if(n%q<=a)
		{
			m=n%q;
		}
		else
		{
			m=a;
		}
		System.out.println((n/q)*a+m);
	}
} Main public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		long n=in.nextLong();
		long a=in.nextLong();
		long b=in.nextLong();
		long q=a+b;
		long m=0;
		if(n%q<=a)
		{
			m=n%q;
		}
		else
		{
			m=a;
		}
		System.out.println((n/q)*a+m);
	} main {
		Scanner in=new Scanner(System.in);
		long n=in.nextLong();
		long a=in.nextLong();
		long b=in.nextLong();
		long q=a+b;
		long m=0;
		if(n%q<=a)
		{
			m=n%q;
		}
		else
		{
			m=a;
		}
		System.out.println((n/q)*a+m);
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) long n=in.nextLong(); n in.nextLong() in.nextLong in long a=in.nextLong(); a in.nextLong() in.nextLong in long b=in.nextLong(); b in.nextLong() in.nextLong in long q=a+b; q a+b a b long m=0; m 0 if(n%q<=a)
		{
			m=n%q;
		}
		else
		{
			m=a;
		} n%q<=a n%q n q a {
			m=n%q;
		} m=n%q m n%q n q {
			m=a;
		} m=a m a System.out.println((n/q)*a+m) System.out.println System.out System System.out (n/q)*a+m (n/q)*a (n/q) n q a m String [] Args Args public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		long n=in.nextLong();
		long a=in.nextLong();
		long b=in.nextLong();
		long q=a+b;
		long m=0;
		if(n%q<=a)
		{
			m=n%q;
		}
		else
		{
			m=a;
		}
		System.out.println((n/q)*a+m);
	}
} public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		long n=in.nextLong();
		long a=in.nextLong();
		long b=in.nextLong();
		long q=a+b;
		long m=0;
		if(n%q<=a)
		{
			m=n%q;
		}
		else
		{
			m=a;
		}
		System.out.println((n/q)*a+m);
	}
} Main
import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		long n=in.nextLong();
		long a=in.nextLong();
		long b=in.nextLong();
		long q=a+b;
		long m=0;
		if(n%q<=a)
		{
			m=n%q;
		}
		else
		{
			m=a;
		}
		System.out.println((n/q)*a+m);
	}
}
	