import java.util.*;

class Main {
	Scanner sc;
	long N, A, B;
	
	private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		
		long c = N/(A+B)*A+Math.min(N%(A+B), A);
		System.out.println(c);
	}

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

	public static void main(String[] args) {
		new Main().calc();
	}
} Main Scanner sc; sc long N N A A B; B private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		
		long c = N/(A+B)*A+Math.min(N%(A+B), A);
		System.out.println(c);
	} calc {
		sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		
		long c = N/(A+B)*A+Math.min(N%(A+B), A);
		System.out.println(c);
	} sc = new Scanner(System.in) sc new Scanner(System.in) N = sc.nextLong() N sc.nextLong() sc.nextLong sc A = sc.nextLong() A sc.nextLong() sc.nextLong sc B = sc.nextLong() B sc.nextLong() sc.nextLong sc long c = N/(A+B)*A+Math.min(N%(A+B), A); c N/(A+B)*A+Math.min(N%(A+B), A) N/(A+B)*A N/(A+B) N (A+B) A B A Math.min(N%(A+B), A) Math.min Math N%(A+B) N (A+B) A B A System.out.println(c) System.out.println System.out System System.out c public static void main(String[] args) {
		new Main().calc();
	} main {
		new Main().calc();
	} new Main().calc() new Main().calc new Main() String[] args args
import java.util.*;

class Main {
	Scanner sc;
	long N, A, B;
	
	private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextLong();
		A = sc.nextLong();
		B = sc.nextLong();
		
		long c = N/(A+B)*A+Math.min(N%(A+B), A);
		System.out.println(c);
	}

	public static void main(String[] args) {
		new Main().calc();
	}
}
