import java.util.*;
public class Main{
	public static void main(String [] args){
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long b = in.nextLong();
		long r = in.nextLong();
		long bl =0;
		bl+=(n/(b+r))*b;
		long rem = n%(b+r);
		if(rem>b){
			bl+=b;
		}
		else{
			bl+=rem;
		}
		System.out.print(bl);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String [] args){
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long b = in.nextLong();
		long r = in.nextLong();
		long bl =0;
		bl+=(n/(b+r))*b;
		long rem = n%(b+r);
		if(rem>b){
			bl+=b;
		}
		else{
			bl+=rem;
		}
		System.out.print(bl);
	}
} Main public static void main(String [] args){
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long b = in.nextLong();
		long r = in.nextLong();
		long bl =0;
		bl+=(n/(b+r))*b;
		long rem = n%(b+r);
		if(rem>b){
			bl+=b;
		}
		else{
			bl+=rem;
		}
		System.out.print(bl);
	} main {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long b = in.nextLong();
		long r = in.nextLong();
		long bl =0;
		bl+=(n/(b+r))*b;
		long rem = n%(b+r);
		if(rem>b){
			bl+=b;
		}
		else{
			bl+=rem;
		}
		System.out.print(bl);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) long n = in.nextLong(); n in.nextLong() in.nextLong in long b = in.nextLong(); b in.nextLong() in.nextLong in long r = in.nextLong(); r in.nextLong() in.nextLong in long bl =0; bl 0 bl+=(n/(b+r))*b bl (n/(b+r))*b (n/(b+r)) n (b+r) b r b long rem = n%(b+r); rem n%(b+r) n (b+r) b r if(rem>b){
			bl+=b;
		}
		else{
			bl+=rem;
		} rem>b rem b {
			bl+=b;
		} bl+=b bl b {
			bl+=rem;
		} bl+=rem bl rem System.out.print(bl) System.out.print System.out System System.out bl String [] args args public class Main{
	public static void main(String [] args){
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long b = in.nextLong();
		long r = in.nextLong();
		long bl =0;
		bl+=(n/(b+r))*b;
		long rem = n%(b+r);
		if(rem>b){
			bl+=b;
		}
		else{
			bl+=rem;
		}
		System.out.print(bl);
	}
} public class Main{
	public static void main(String [] args){
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long b = in.nextLong();
		long r = in.nextLong();
		long bl =0;
		bl+=(n/(b+r))*b;
		long rem = n%(b+r);
		if(rem>b){
			bl+=b;
		}
		else{
			bl+=rem;
		}
		System.out.print(bl);
	}
} Main
import java.util.*;
public class Main{
	public static void main(String [] args){
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long b = in.nextLong();
		long r = in.nextLong();
		long bl =0;
		bl+=(n/(b+r))*b;
		long rem = n%(b+r);
		if(rem>b){
			bl+=b;
		}
		else{
			bl+=rem;
		}
		System.out.print(bl);
	}
}