import java.util.Scanner;
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 ab = a+b;
		long ans;
		
		if(n%ab==0) {
			ans = a*(n/ab);
		}
		else {
			ans = a*(n/ab)+Math.min(n%ab, a);
		}

		System.out.println(ans);

	}

} import java.util.Scanner; Scanner 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 ab = a+b;
		long ans;
		
		if(n%ab==0) {
			ans = a*(n/ab);
		}
		else {
			ans = a*(n/ab)+Math.min(n%ab, a);
		}

		System.out.println(ans);

	}

} 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 ab = a+b;
		long ans;
		
		if(n%ab==0) {
			ans = a*(n/ab);
		}
		else {
			ans = a*(n/ab)+Math.min(n%ab, a);
		}

		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		long ab = a+b;
		long ans;
		
		if(n%ab==0) {
			ans = a*(n/ab);
		}
		else {
			ans = a*(n/ab)+Math.min(n%ab, a);
		}

		System.out.println(ans);

	} 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 ab = a+b; ab a+b a b long ans; ans if(n%ab==0) {
			ans = a*(n/ab);
		}
		else {
			ans = a*(n/ab)+Math.min(n%ab, a);
		} n%ab==0 n%ab n ab 0 {
			ans = a*(n/ab);
		} ans = a*(n/ab) ans a*(n/ab) a (n/ab) n ab {
			ans = a*(n/ab)+Math.min(n%ab, a);
		} ans = a*(n/ab)+Math.min(n%ab, a) ans a*(n/ab)+Math.min(n%ab, a) a*(n/ab) a (n/ab) n ab Math.min(n%ab, a) Math.min Math n%ab n ab 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 sc = new Scanner(System.in);
		
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		long ab = a+b;
		long ans;
		
		if(n%ab==0) {
			ans = a*(n/ab);
		}
		else {
			ans = a*(n/ab)+Math.min(n%ab, a);
		}

		System.out.println(ans);

	}

} 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 ab = a+b;
		long ans;
		
		if(n%ab==0) {
			ans = a*(n/ab);
		}
		else {
			ans = a*(n/ab)+Math.min(n%ab, a);
		}

		System.out.println(ans);

	}

} Main
import java.util.Scanner;
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 ab = a+b;
		long ans;
		
		if(n%ab==0) {
			ans = a*(n/ab);
		}
		else {
			ans = a*(n/ab)+Math.min(n%ab, a);
		}

		System.out.println(ans);

	}

}