import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		long N = Long.parseLong(n);
		String a = sc.next();
		long A = Long.parseLong(a);
		String b = sc.next();
		long B = Long.parseLong(b);
		long ans;
		long mult = N / (A + B);
		long ex = N - (A + B) * mult;
		if(A == 0){
			ans = 0;
		}else{
			ans = mult * A;
			if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			}
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		long N = Long.parseLong(n);
		String a = sc.next();
		long A = Long.parseLong(a);
		String b = sc.next();
		long B = Long.parseLong(b);
		long ans;
		long mult = N / (A + B);
		long ex = N - (A + B) * mult;
		if(A == 0){
			ans = 0;
		}else{
			ans = mult * A;
			if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		long N = Long.parseLong(n);
		String a = sc.next();
		long A = Long.parseLong(a);
		String b = sc.next();
		long B = Long.parseLong(b);
		long ans;
		long mult = N / (A + B);
		long ex = N - (A + B) * mult;
		if(A == 0){
			ans = 0;
		}else{
			ans = mult * A;
			if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		long N = Long.parseLong(n);
		String a = sc.next();
		long A = Long.parseLong(a);
		String b = sc.next();
		long B = Long.parseLong(b);
		long ans;
		long mult = N / (A + B);
		long ex = N - (A + B) * mult;
		if(A == 0){
			ans = 0;
		}else{
			ans = mult * A;
			if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc long N = Long.parseLong(n); N Long.parseLong(n) Long.parseLong Long n String a = sc.next(); a sc.next() sc.next sc long A = Long.parseLong(a); A Long.parseLong(a) Long.parseLong Long a String b = sc.next(); b sc.next() sc.next sc long B = Long.parseLong(b); B Long.parseLong(b) Long.parseLong Long b long ans; ans long mult = N / (A + B); mult N / (A + B) N (A + B) A B long ex = N - (A + B) * mult; ex N - (A + B) * mult N (A + B) * mult (A + B) A B mult if(A == 0){
			ans = 0;
		}else{
			ans = mult * A;
			if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			}
		} A == 0 A 0 {
			ans = 0;
		} ans = 0 ans 0 {
			ans = mult * A;
			if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			}
		} ans = mult * A ans mult * A mult A if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			} ex <= A ex A {
				ans += ex;
			} ans += ex ans ex {
				ans += A;
			} ans += A ans A 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);
		String n = sc.next();
		long N = Long.parseLong(n);
		String a = sc.next();
		long A = Long.parseLong(a);
		String b = sc.next();
		long B = Long.parseLong(b);
		long ans;
		long mult = N / (A + B);
		long ex = N - (A + B) * mult;
		if(A == 0){
			ans = 0;
		}else{
			ans = mult * A;
			if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			}
		}
		System.out.println(ans);
	}
} public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		long N = Long.parseLong(n);
		String a = sc.next();
		long A = Long.parseLong(a);
		String b = sc.next();
		long B = Long.parseLong(b);
		long ans;
		long mult = N / (A + B);
		long ex = N - (A + B) * mult;
		if(A == 0){
			ans = 0;
		}else{
			ans = mult * A;
			if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		long N = Long.parseLong(n);
		String a = sc.next();
		long A = Long.parseLong(a);
		String b = sc.next();
		long B = Long.parseLong(b);
		long ans;
		long mult = N / (A + B);
		long ex = N - (A + B) * mult;
		if(A == 0){
			ans = 0;
		}else{
			ans = mult * A;
			if(ex <= A){
				ans += ex;
			}else{
				ans += A;
			}
		}
		System.out.println(ans);
	}
}