import java.util.*;
 
 
public class Main {
	public static void main (String[] args){
		Scanner sc =  new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long Q = N/(A+B);
		long ex = N%(A+B);
		long R = 0;
		if(A > 0) {
			if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			}
		}
		System.out.println(R);
	}
} import java.util.*; util.* java public class Main {
	public static void main (String[] args){
		Scanner sc =  new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long Q = N/(A+B);
		long ex = N%(A+B);
		long R = 0;
		if(A > 0) {
			if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			}
		}
		System.out.println(R);
	}
} Main public static void main (String[] args){
		Scanner sc =  new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long Q = N/(A+B);
		long ex = N%(A+B);
		long R = 0;
		if(A > 0) {
			if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			}
		}
		System.out.println(R);
	} main {
		Scanner sc =  new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long Q = N/(A+B);
		long ex = N%(A+B);
		long R = 0;
		if(A > 0) {
			if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			}
		}
		System.out.println(R);
	} Scanner sc =  new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc long B = sc.nextLong(); B sc.nextLong() sc.nextLong sc long Q = N/(A+B); Q N/(A+B) N (A+B) A B long ex = N%(A+B); ex N%(A+B) N (A+B) A B long R = 0; R 0 if(A > 0) {
			if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			}
		} A > 0 A 0 {
			if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			}
		} if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			} ex < A ex A {
				R = A * Q + ex;
			} R = A * Q + ex R A * Q + ex A * Q A Q ex if(ex >= A) {
				R = (Q+1) * A;
			} ex >= A ex A {
				R = (Q+1) * A;
			} R = (Q+1) * A R (Q+1) * A (Q+1) Q 1 A System.out.println(R) System.out.println System.out System System.out R String[] args args public class Main {
	public static void main (String[] args){
		Scanner sc =  new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long Q = N/(A+B);
		long ex = N%(A+B);
		long R = 0;
		if(A > 0) {
			if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			}
		}
		System.out.println(R);
	}
} public class Main {
	public static void main (String[] args){
		Scanner sc =  new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long Q = N/(A+B);
		long ex = N%(A+B);
		long R = 0;
		if(A > 0) {
			if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			}
		}
		System.out.println(R);
	}
} Main
import java.util.*;
 
 
public class Main {
	public static void main (String[] args){
		Scanner sc =  new Scanner(System.in);
		long N = sc.nextLong();
		long A = sc.nextLong();
		long B = sc.nextLong();
		long Q = N/(A+B);
		long ex = N%(A+B);
		long R = 0;
		if(A > 0) {
			if(ex < A) {
				R = A * Q + ex;
			}
			else if(ex >= A) {
				R = (Q+1) * A;
			}
		}
		System.out.println(R);
	}
}