import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			long n = sc.nextLong();
			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long repCount = n / (a+b);
			
			long residual = n % (a+b);
			
			long ans = repCount * a;
			
			if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			}
			
			System.out.println(ans);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			long n = sc.nextLong();
			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long repCount = n / (a+b);
			
			long residual = n % (a+b);
			
			long ans = repCount * a;
			
			if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			}
			
			System.out.println(ans);
		}
	}
} Main public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			long n = sc.nextLong();
			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long repCount = n / (a+b);
			
			long residual = n % (a+b);
			
			long ans = repCount * a;
			
			if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			}
			
			System.out.println(ans);
		}
	} main {
		try(Scanner sc = new Scanner(System.in)) {
			
			long n = sc.nextLong();
			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long repCount = n / (a+b);
			
			long residual = n % (a+b);
			
			long ans = repCount * a;
			
			if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			}
			
			System.out.println(ans);
		}
	} try(Scanner sc = new Scanner(System.in)) {
			
			long n = sc.nextLong();
			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long repCount = n / (a+b);
			
			long residual = n % (a+b);
			
			long ans = repCount * a;
			
			if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			}
			
			System.out.println(ans);
		} {
			
			long n = sc.nextLong();
			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long repCount = n / (a+b);
			
			long residual = n % (a+b);
			
			long ans = repCount * a;
			
			if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			}
			
			System.out.println(ans);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) 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 repCount = n / (a+b); repCount n / (a+b) n (a+b) a b long residual = n % (a+b); residual n % (a+b) n (a+b) a b long ans = repCount * a; ans repCount * a repCount a if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			} a <= residual a residual {
				ans += a;
			} ans += a ans a {
				ans += residual;
			} ans += residual ans residual 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){
		try(Scanner sc = new Scanner(System.in)) {
			
			long n = sc.nextLong();
			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long repCount = n / (a+b);
			
			long residual = n % (a+b);
			
			long ans = repCount * a;
			
			if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			}
			
			System.out.println(ans);
		}
	}
} public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			long n = sc.nextLong();
			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long repCount = n / (a+b);
			
			long residual = n % (a+b);
			
			long ans = repCount * a;
			
			if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			}
			
			System.out.println(ans);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			long n = sc.nextLong();
			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long repCount = n / (a+b);
			
			long residual = n % (a+b);
			
			long ans = repCount * a;
			
			if ( a <= residual ) {
				ans += a;
			}
			else {
				ans += residual;
			}
			
			System.out.println(ans);
		}
	}
}