import java.io.*;
import java.math.*;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		long numCycles = N/(A+B);
		long ans = A*numCycles;
		N%=(A+B);
		ans+=Math.min(N, A);
		System.out.println(ans);
	}
} import java.io.*; io.* java import java.math.*; math.* java import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		long numCycles = N/(A+B);
		long ans = A*numCycles;
		N%=(A+B);
		ans+=Math.min(N, A);
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		long numCycles = N/(A+B);
		long ans = A*numCycles;
		N%=(A+B);
		ans+=Math.min(N, A);
		System.out.println(ans);
	} main {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		long numCycles = N/(A+B);
		long ans = A*numCycles;
		N%=(A+B);
		ans+=Math.min(N, A);
		System.out.println(ans);
	} Scanner input = new Scanner(System.in); input new Scanner(System.in) long N = input.nextLong(); N input.nextLong() input.nextLong input long A = input.nextLong(); A input.nextLong() input.nextLong input long B = input.nextLong(); B input.nextLong() input.nextLong input long numCycles = N/(A+B); numCycles N/(A+B) N (A+B) A B long ans = A*numCycles; ans A*numCycles A numCycles N%=(A+B) N (A+B) A B ans+=Math.min(N, A) ans Math.min(N, A) Math.min Math N 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 input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		long numCycles = N/(A+B);
		long ans = A*numCycles;
		N%=(A+B);
		ans+=Math.min(N, A);
		System.out.println(ans);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		long numCycles = N/(A+B);
		long ans = A*numCycles;
		N%=(A+B);
		ans+=Math.min(N, A);
		System.out.println(ans);
	}
} Main
import java.io.*;
import java.math.*;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long A = input.nextLong();
		long B = input.nextLong();
		long numCycles = N/(A+B);
		long ans = A*numCycles;
		N%=(A+B);
		ans+=Math.min(N, A);
		System.out.println(ans);
	}
}