import java.util.*;


public class Main {

	static void log(long i) {
		System.out.println(i);
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		long pos = sc.nextLong();
		long numBlue = sc.nextLong();
		long numRed = sc.nextLong();
		
		long cntLoop = pos / (numBlue+numRed);
		long base = (numBlue+numRed)*cntLoop;
		long dif = pos - base;
		long cntLast;

		if (dif < numBlue)
			cntLast = dif;
		else
			cntLast = numBlue;
		dif = cntLoop*numBlue+cntLast;
		
		sc.close();
		log(dif);
	}

	// test 2 B - String Palindrome
//	public static void main(String args[]) {
//		Scanner sc = new Scanner(System.in);
//		
//		long amount = sc.nextlong();
//
//		// 500
//		long c500=0;
//		c500 = amount/500;
//		
//		// 5
//		long c5 = (amount - (c500 * 500)) / 5;
//
//		// calc 螫峨＠縺?
//		log( c500 * 1000 + c5 * 5 );
//		
//		sc.close();
//	}
} import java.util.*; util.* java public class Main {

	static void log(long i) {
		System.out.println(i);
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		long pos = sc.nextLong();
		long numBlue = sc.nextLong();
		long numRed = sc.nextLong();
		
		long cntLoop = pos / (numBlue+numRed);
		long base = (numBlue+numRed)*cntLoop;
		long dif = pos - base;
		long cntLast;

		if (dif < numBlue)
			cntLast = dif;
		else
			cntLast = numBlue;
		dif = cntLoop*numBlue+cntLast;
		
		sc.close();
		log(dif);
	}

	// test 2 B - String Palindrome
//	public static void main(String args[]) {
//		Scanner sc = new Scanner(System.in);
//		
//		long amount = sc.nextlong();
//
//		// 500
//		long c500=0;
//		c500 = amount/500;
//		
//		// 5
//		long c5 = (amount - (c500 * 500)) / 5;
//
//		// calc 螫峨＠縺?
//		log( c500 * 1000 + c5 * 5 );
//		
//		sc.close();
//	}
} Main static void log(long i) {
		System.out.println(i);
	} log {
		System.out.println(i);
	} System.out.println(i) System.out.println System.out System System.out i long i i public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		long pos = sc.nextLong();
		long numBlue = sc.nextLong();
		long numRed = sc.nextLong();
		
		long cntLoop = pos / (numBlue+numRed);
		long base = (numBlue+numRed)*cntLoop;
		long dif = pos - base;
		long cntLast;

		if (dif < numBlue)
			cntLast = dif;
		else
			cntLast = numBlue;
		dif = cntLoop*numBlue+cntLast;
		
		sc.close();
		log(dif);
	} main {
		Scanner sc = new Scanner(System.in);
		
		long pos = sc.nextLong();
		long numBlue = sc.nextLong();
		long numRed = sc.nextLong();
		
		long cntLoop = pos / (numBlue+numRed);
		long base = (numBlue+numRed)*cntLoop;
		long dif = pos - base;
		long cntLast;

		if (dif < numBlue)
			cntLast = dif;
		else
			cntLast = numBlue;
		dif = cntLoop*numBlue+cntLast;
		
		sc.close();
		log(dif);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long pos = sc.nextLong(); pos sc.nextLong() sc.nextLong sc long numBlue = sc.nextLong(); numBlue sc.nextLong() sc.nextLong sc long numRed = sc.nextLong(); numRed sc.nextLong() sc.nextLong sc long cntLoop = pos / (numBlue+numRed); cntLoop pos / (numBlue+numRed) pos (numBlue+numRed) numBlue numRed long base = (numBlue+numRed)*cntLoop; base (numBlue+numRed)*cntLoop (numBlue+numRed) numBlue numRed cntLoop long dif = pos - base; dif pos - base pos base long cntLast; cntLast if (dif < numBlue)
			cntLast = dif;
		else
			cntLast = numBlue; dif < numBlue dif numBlue cntLast = dif cntLast dif cntLast = numBlue cntLast numBlue dif = cntLoop*numBlue+cntLast dif cntLoop*numBlue+cntLast cntLoop*numBlue cntLoop numBlue cntLast sc.close() sc.close sc log(dif) log dif String args[] args public class Main {

	static void log(long i) {
		System.out.println(i);
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		long pos = sc.nextLong();
		long numBlue = sc.nextLong();
		long numRed = sc.nextLong();
		
		long cntLoop = pos / (numBlue+numRed);
		long base = (numBlue+numRed)*cntLoop;
		long dif = pos - base;
		long cntLast;

		if (dif < numBlue)
			cntLast = dif;
		else
			cntLast = numBlue;
		dif = cntLoop*numBlue+cntLast;
		
		sc.close();
		log(dif);
	}

	// test 2 B - String Palindrome
//	public static void main(String args[]) {
//		Scanner sc = new Scanner(System.in);
//		
//		long amount = sc.nextlong();
//
//		// 500
//		long c500=0;
//		c500 = amount/500;
//		
//		// 5
//		long c5 = (amount - (c500 * 500)) / 5;
//
//		// calc 螫峨＠縺?
//		log( c500 * 1000 + c5 * 5 );
//		
//		sc.close();
//	}
} public class Main {

	static void log(long i) {
		System.out.println(i);
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		long pos = sc.nextLong();
		long numBlue = sc.nextLong();
		long numRed = sc.nextLong();
		
		long cntLoop = pos / (numBlue+numRed);
		long base = (numBlue+numRed)*cntLoop;
		long dif = pos - base;
		long cntLast;

		if (dif < numBlue)
			cntLast = dif;
		else
			cntLast = numBlue;
		dif = cntLoop*numBlue+cntLast;
		
		sc.close();
		log(dif);
	}

	// test 2 B - String Palindrome
//	public static void main(String args[]) {
//		Scanner sc = new Scanner(System.in);
//		
//		long amount = sc.nextlong();
//
//		// 500
//		long c500=0;
//		c500 = amount/500;
//		
//		// 5
//		long c5 = (amount - (c500 * 500)) / 5;
//
//		// calc 螫峨＠縺?
//		log( c500 * 1000 + c5 * 5 );
//		
//		sc.close();
//	}
} Main
import java.util.*;


public class Main {

	static void log(long i) {
		System.out.println(i);
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		long pos = sc.nextLong();
		long numBlue = sc.nextLong();
		long numRed = sc.nextLong();
		
		long cntLoop = pos / (numBlue+numRed);
		long base = (numBlue+numRed)*cntLoop;
		long dif = pos - base;
		long cntLast;

		if (dif < numBlue)
			cntLast = dif;
		else
			cntLast = numBlue;
		dif = cntLoop*numBlue+cntLast;
		
		sc.close();
		log(dif);
	}

	// test 2 B - String Palindrome
//	public static void main(String args[]) {
//		Scanner sc = new Scanner(System.in);
//		
//		long amount = sc.nextlong();
//
//		// 500
//		long c500=0;
//		c500 = amount/500;
//		
//		// 5
//		long c5 = (amount - (c500 * 500)) / 5;
//
//		// calc 螫峨＠縺?
//		log( c500 * 1000 + c5 * 5 );
//		
//		sc.close();
//	}
}
