import java.util.Scanner;


public class Main {

	//残り数問が結果合わない
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		String strN = sc.next();
		String strA = sc.next();
		String strB = sc.next();
		// 1 <= N <= 10^18
		long N = Long.parseLong(strN);

		//A >= 0
		long A = Long.parseLong(strA);

		//B >= 0
		long B = Long.parseLong(strB);

		boolean flg = false;

		if(A == 0) {
			System.out.println(0);
			return;
		}

		long roop = N / (A+B);
		long amari = N % (A+B);
		if(amari > A) {
			amari = A;
		}

		System.out.println(roop * A + amari);

	}

} import java.util.Scanner; Scanner java.util public class Main {

	//残り数問が結果合わない
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		String strN = sc.next();
		String strA = sc.next();
		String strB = sc.next();
		// 1 <= N <= 10^18
		long N = Long.parseLong(strN);

		//A >= 0
		long A = Long.parseLong(strA);

		//B >= 0
		long B = Long.parseLong(strB);

		boolean flg = false;

		if(A == 0) {
			System.out.println(0);
			return;
		}

		long roop = N / (A+B);
		long amari = N % (A+B);
		if(amari > A) {
			amari = A;
		}

		System.out.println(roop * A + amari);

	}

} Main //残り数問が結果合わない
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		String strN = sc.next();
		String strA = sc.next();
		String strB = sc.next();
		// 1 <= N <= 10^18
		long N = Long.parseLong(strN);

		//A >= 0
		long A = Long.parseLong(strA);

		//B >= 0
		long B = Long.parseLong(strB);

		boolean flg = false;

		if(A == 0) {
			System.out.println(0);
			return;
		}

		long roop = N / (A+B);
		long amari = N % (A+B);
		if(amari > A) {
			amari = A;
		}

		System.out.println(roop * A + amari);

	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		String strN = sc.next();
		String strA = sc.next();
		String strB = sc.next();
		// 1 <= N <= 10^18
		long N = Long.parseLong(strN);

		//A >= 0
		long A = Long.parseLong(strA);

		//B >= 0
		long B = Long.parseLong(strB);

		boolean flg = false;

		if(A == 0) {
			System.out.println(0);
			return;
		}

		long roop = N / (A+B);
		long amari = N % (A+B);
		if(amari > A) {
			amari = A;
		}

		System.out.println(roop * A + amari);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String strN = sc.next(); strN sc.next() sc.next sc String strA = sc.next(); strA sc.next() sc.next sc String strB = sc.next(); strB sc.next() sc.next sc long N = Long.parseLong(strN); N Long.parseLong(strN) Long.parseLong Long strN long A = Long.parseLong(strA); A Long.parseLong(strA) Long.parseLong Long strA long B = Long.parseLong(strB); B Long.parseLong(strB) Long.parseLong Long strB boolean flg = false; flg false if(A == 0) {
			System.out.println(0);
			return;
		} A == 0 A 0 {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; long roop = N / (A+B); roop N / (A+B) N (A+B) A B long amari = N % (A+B); amari N % (A+B) N (A+B) A B if(amari > A) {
			amari = A;
		} amari > A amari A {
			amari = A;
		} amari = A amari A System.out.println(roop * A + amari) System.out.println System.out System System.out roop * A + amari roop * A roop A amari String[] args args public class Main {

	//残り数問が結果合わない
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		String strN = sc.next();
		String strA = sc.next();
		String strB = sc.next();
		// 1 <= N <= 10^18
		long N = Long.parseLong(strN);

		//A >= 0
		long A = Long.parseLong(strA);

		//B >= 0
		long B = Long.parseLong(strB);

		boolean flg = false;

		if(A == 0) {
			System.out.println(0);
			return;
		}

		long roop = N / (A+B);
		long amari = N % (A+B);
		if(amari > A) {
			amari = A;
		}

		System.out.println(roop * A + amari);

	}

} public class Main {

	//残り数問が結果合わない
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		String strN = sc.next();
		String strA = sc.next();
		String strB = sc.next();
		// 1 <= N <= 10^18
		long N = Long.parseLong(strN);

		//A >= 0
		long A = Long.parseLong(strA);

		//B >= 0
		long B = Long.parseLong(strB);

		boolean flg = false;

		if(A == 0) {
			System.out.println(0);
			return;
		}

		long roop = N / (A+B);
		long amari = N % (A+B);
		if(amari > A) {
			amari = A;
		}

		System.out.println(roop * A + amari);

	}

} Main
import java.util.Scanner;


public class Main {

	//残り数問が結果合わない
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		String strN = sc.next();
		String strA = sc.next();
		String strB = sc.next();
		// 1 <= N <= 10^18
		long N = Long.parseLong(strN);

		//A >= 0
		long A = Long.parseLong(strA);

		//B >= 0
		long B = Long.parseLong(strB);

		boolean flg = false;

		if(A == 0) {
			System.out.println(0);
			return;
		}

		long roop = N / (A+B);
		long amari = N % (A+B);
		if(amari > A) {
			amari = A;
		}

		System.out.println(roop * A + amari);

	}

}
