import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

		//B+RがNよりも大きい場合
		long count = target / sum;
		long answer = b * count;

		answer += Math.min(target%sum, b);

		System.out.println(answer);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

		//B+RがNよりも大きい場合
		long count = target / sum;
		long answer = b * count;

		answer += Math.min(target%sum, b);

		System.out.println(answer);
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

		//B+RがNよりも大きい場合
		long count = target / sum;
		long answer = b * count;

		answer += Math.min(target%sum, b);

		System.out.println(answer);
	} main {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

		//B+RがNよりも大きい場合
		long count = target / sum;
		long answer = b * count;

		answer += Math.min(target%sum, b);

		System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long target = sc.nextLong(); target sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long r = sc.nextLong(); r sc.nextLong() sc.nextLong sc long sum = r + b; sum r + b r b long count = target / sum; count target / sum target sum long answer = b * count; answer b * count b count answer += Math.min(target%sum, b) answer Math.min(target%sum, b) Math.min Math target%sum target sum b System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

		//B+RがNよりも大きい場合
		long count = target / sum;
		long answer = b * count;

		answer += Math.min(target%sum, b);

		System.out.println(answer);
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

		//B+RがNよりも大きい場合
		long count = target / sum;
		long answer = b * count;

		answer += Math.min(target%sum, b);

		System.out.println(answer);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long target = sc.nextLong();
		long b = sc.nextLong();
		long r = sc.nextLong();
		long sum = r + b;

		//B+RがNよりも大きい場合
		long count = target / sum;
		long answer = b * count;

		answer += Math.min(target%sum, b);

		System.out.println(answer);
	}
}
