
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main {
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine());
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}
		return ans;
	}
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		br=new BufferedReader(new InputStreamReader(System.in));
		long[]ar=splitL();
		long n=ar[0];
		long a=ar[1];
		long b=ar[2];
		long x=n/(a+b);
		long y=n%(a+b);
		long res=x*a+Math.min(y, a);
		System.out.println(res);
	}
} import java.io.*; io.* java import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine());
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}
		return ans;
	}
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		br=new BufferedReader(new InputStreamReader(System.in));
		long[]ar=splitL();
		long n=ar[0];
		long a=ar[1];
		long b=ar[2];
		long x=n/(a+b);
		long y=n%(a+b);
		long res=x*a+Math.min(y, a);
		System.out.println(res);
	}
} Main static BufferedReader br; br static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine());
	} cin {
		return Integer.valueOf(br.readLine());
	} return Integer.valueOf(br.readLine()); Integer.valueOf(br.readLine()) Integer.valueOf Integer br.readLine() br.readLine br static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}
		return ans;
	} split {
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}
		return ans;
	} String[] cmd=br.readLine().split(" "); cmd br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] ans=new int[cmd.length]; ans new int[cmd.length] cmd.length cmd cmd.length for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		} int i=0; int i=0; i 0 i<cmd.length i cmd.length cmd cmd.length i++ i++ i {
			ans[i]=Integer.valueOf(cmd[i]);
		} {
			ans[i]=Integer.valueOf(cmd[i]);
		} ans[i]=Integer.valueOf(cmd[i]) ans[i] ans i Integer.valueOf(cmd[i]) Integer.valueOf Integer cmd[i] cmd i return ans; ans static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	} splitL {
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	} String[] cmd=br.readLine().split(" "); cmd br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long[] ans=new long[cmd.length]; ans new long[cmd.length] cmd.length cmd cmd.length for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		} int i=0; int i=0; i 0 i<cmd.length i cmd.length cmd cmd.length i++ i++ i {
			ans[i]=Long.valueOf(cmd[i]);
		} {
			ans[i]=Long.valueOf(cmd[i]);
		} ans[i]=Long.valueOf(cmd[i]) ans[i] ans i Long.valueOf(cmd[i]) Long.valueOf Long cmd[i] cmd i return ans; ans public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		br=new BufferedReader(new InputStreamReader(System.in));
		long[]ar=splitL();
		long n=ar[0];
		long a=ar[1];
		long b=ar[2];
		long x=n/(a+b);
		long y=n%(a+b);
		long res=x*a+Math.min(y, a);
		System.out.println(res);
	} main {
		// TODO Auto-generated method stub
		br=new BufferedReader(new InputStreamReader(System.in));
		long[]ar=splitL();
		long n=ar[0];
		long a=ar[1];
		long b=ar[2];
		long x=n/(a+b);
		long y=n%(a+b);
		long res=x*a+Math.min(y, a);
		System.out.println(res);
	} br=new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) long[]ar=splitL(); ar splitL() splitL long n=ar[0]; n ar[0] ar 0 long a=ar[1]; a ar[1] ar 1 long b=ar[2]; b ar[2] ar 2 long x=n/(a+b); x n/(a+b) n (a+b) a b long y=n%(a+b); y n%(a+b) n (a+b) a b long res=x*a+Math.min(y, a); res x*a+Math.min(y, a) x*a x a Math.min(y, a) Math.min Math y a System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine());
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}
		return ans;
	}
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		br=new BufferedReader(new InputStreamReader(System.in));
		long[]ar=splitL();
		long n=ar[0];
		long a=ar[1];
		long b=ar[2];
		long x=n/(a+b);
		long y=n%(a+b);
		long res=x*a+Math.min(y, a);
		System.out.println(res);
	}
} public class Main {
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine());
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}
		return ans;
	}
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		br=new BufferedReader(new InputStreamReader(System.in));
		long[]ar=splitL();
		long n=ar[0];
		long a=ar[1];
		long b=ar[2];
		long x=n/(a+b);
		long y=n%(a+b);
		long res=x*a+Math.min(y, a);
		System.out.println(res);
	}
} Main

import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main {
	static BufferedReader br;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine());
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}
		return ans;
	}
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		br=new BufferedReader(new InputStreamReader(System.in));
		long[]ar=splitL();
		long n=ar[0];
		long a=ar[1];
		long b=ar[2];
		long x=n/(a+b);
		long y=n%(a+b);
		long res=x*a+Math.min(y, a);
		System.out.println(res);
	}
}
