import java.util.Scanner;

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 count = n/(a+b);
		long rest = n%(a+b);
		long blue = 0;
		if(rest < a){
			blue = (a * count) + rest;
		}else {
			blue = a * (count + 1);
		}
		System.out.println(blue);
	}
} import java.util.Scanner; Scanner java.util 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 count = n/(a+b);
		long rest = n%(a+b);
		long blue = 0;
		if(rest < a){
			blue = (a * count) + rest;
		}else {
			blue = a * (count + 1);
		}
		System.out.println(blue);
	}
} 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 count = n/(a+b);
		long rest = n%(a+b);
		long blue = 0;
		if(rest < a){
			blue = (a * count) + rest;
		}else {
			blue = a * (count + 1);
		}
		System.out.println(blue);
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		long count = n/(a+b);
		long rest = n%(a+b);
		long blue = 0;
		if(rest < a){
			blue = (a * count) + rest;
		}else {
			blue = a * (count + 1);
		}
		System.out.println(blue);
	} 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 count = n/(a+b); count n/(a+b) n (a+b) a b long rest = n%(a+b); rest n%(a+b) n (a+b) a b long blue = 0; blue 0 if(rest < a){
			blue = (a * count) + rest;
		}else {
			blue = a * (count + 1);
		} rest < a rest a {
			blue = (a * count) + rest;
		} blue = (a * count) + rest blue (a * count) + rest (a * count) a count rest {
			blue = a * (count + 1);
		} blue = a * (count + 1) blue a * (count + 1) a (count + 1) count 1 System.out.println(blue) System.out.println System.out System System.out blue String[] args args
import java.util.Scanner;

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 count = n/(a+b);
		long rest = n%(a+b);
		long blue = 0;
		if(rest < a){
			blue = (a * count) + rest;
		}else {
			blue = a * (count + 1);
		}
		System.out.println(blue);
	}
}