

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


public class  Main{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		long size=sc.nextLong();
		long blue=sc.nextLong();
		long red=sc.nextLong();
		long total=blue+red;
		long ans=0;
		long div=0;
		long mod=0;
		if(blue==0)
		{ans=0;}
		else if(size<total)
		{
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		}
		else if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		}
		System.out.println(ans);

		
	}



	}






 import java.util.*; util.* java import java.io.*; io.* java public class  Main{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		long size=sc.nextLong();
		long blue=sc.nextLong();
		long red=sc.nextLong();
		long total=blue+red;
		long ans=0;
		long div=0;
		long mod=0;
		if(blue==0)
		{ans=0;}
		else if(size<total)
		{
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		}
		else if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		}
		System.out.println(ans);

		
	}



	} Main public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		long size=sc.nextLong();
		long blue=sc.nextLong();
		long red=sc.nextLong();
		long total=blue+red;
		long ans=0;
		long div=0;
		long mod=0;
		if(blue==0)
		{ans=0;}
		else if(size<total)
		{
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		}
		else if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		}
		System.out.println(ans);

		
	} main {
		Scanner sc=new Scanner(System.in);
		long size=sc.nextLong();
		long blue=sc.nextLong();
		long red=sc.nextLong();
		long total=blue+red;
		long ans=0;
		long div=0;
		long mod=0;
		if(blue==0)
		{ans=0;}
		else if(size<total)
		{
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		}
		else if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		}
		System.out.println(ans);

		
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) long size=sc.nextLong(); size sc.nextLong() sc.nextLong sc long blue=sc.nextLong(); blue sc.nextLong() sc.nextLong sc long red=sc.nextLong(); red sc.nextLong() sc.nextLong sc long total=blue+red; total blue+red blue red long ans=0; ans 0 long div=0; div 0 long mod=0; mod 0 if(blue==0)
		{ans=0;}
		else if(size<total)
		{
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		}
		else if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		} blue==0 blue 0 {ans=0;} ans=0 ans 0 if(size<total)
		{
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		}
		else if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		} size<total size total {
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		} if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			} size>=blue size blue {
				ans=blue;
			} ans=blue ans blue if(size<blue)
			{
				ans=size;
			} size<blue size blue {
				ans=size;
			} ans=size ans size if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		} size>=total size total {
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		} div=size/total div size/total size total mod=size%total mod size%total size total if(mod>blue)
			{
				mod=blue;
			} mod>blue mod blue {
				mod=blue;
			} mod=blue mod blue ans=(div*blue)+mod ans (div*blue)+mod (div*blue) div blue mod 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 size=sc.nextLong();
		long blue=sc.nextLong();
		long red=sc.nextLong();
		long total=blue+red;
		long ans=0;
		long div=0;
		long mod=0;
		if(blue==0)
		{ans=0;}
		else if(size<total)
		{
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		}
		else if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		}
		System.out.println(ans);

		
	}



	} public class  Main{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		long size=sc.nextLong();
		long blue=sc.nextLong();
		long red=sc.nextLong();
		long total=blue+red;
		long ans=0;
		long div=0;
		long mod=0;
		if(blue==0)
		{ans=0;}
		else if(size<total)
		{
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		}
		else if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		}
		System.out.println(ans);

		
	}



	} Main


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


public class  Main{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		long size=sc.nextLong();
		long blue=sc.nextLong();
		long red=sc.nextLong();
		long total=blue+red;
		long ans=0;
		long div=0;
		long mod=0;
		if(blue==0)
		{ans=0;}
		else if(size<total)
		{
			 if(size>=blue)
			{
				ans=blue;
			}
			else if(size<blue)
			{
				ans=size;
			}
		}
		else if(size>=total)
		{
			
			div=size/total;
			mod=size%total;
			if(mod>blue)
			{
				mod=blue;
			}
			ans=(div*blue)+mod;
		
		}
		System.out.println(ans);

		
	}



	}







