

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] as = br.readLine().split(" ");
		long n = Long.parseLong(as[0]);
		long a = Long.parseLong(as[2]);
		long b = Long.parseLong(as[1]);
		long p = n %(a+b);
		if(p > b ) {p = b;}
		System.out.println((n/(a+b))*b + p);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] as = br.readLine().split(" ");
		long n = Long.parseLong(as[0]);
		long a = Long.parseLong(as[2]);
		long b = Long.parseLong(as[1]);
		long p = n %(a+b);
		if(p > b ) {p = b;}
		System.out.println((n/(a+b))*b + p);
	}

} Main public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] as = br.readLine().split(" ");
		long n = Long.parseLong(as[0]);
		long a = Long.parseLong(as[2]);
		long b = Long.parseLong(as[1]);
		long p = n %(a+b);
		if(p > b ) {p = b;}
		System.out.println((n/(a+b))*b + p);
	} main {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] as = br.readLine().split(" ");
		long n = Long.parseLong(as[0]);
		long a = Long.parseLong(as[2]);
		long b = Long.parseLong(as[1]);
		long p = n %(a+b);
		if(p > b ) {p = b;}
		System.out.println((n/(a+b))*b + p);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] as = br.readLine().split(" "); as br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long n = Long.parseLong(as[0]); n Long.parseLong(as[0]) Long.parseLong Long as[0] as 0 long a = Long.parseLong(as[2]); a Long.parseLong(as[2]) Long.parseLong Long as[2] as 2 long b = Long.parseLong(as[1]); b Long.parseLong(as[1]) Long.parseLong Long as[1] as 1 long p = n %(a+b); p n %(a+b) n (a+b) a b if(p > b ) {p = b;} p > b p b {p = b;} p = b p b System.out.println((n/(a+b))*b + p) System.out.println System.out System System.out (n/(a+b))*b + p (n/(a+b))*b (n/(a+b)) n (a+b) a b b p String[] args args public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] as = br.readLine().split(" ");
		long n = Long.parseLong(as[0]);
		long a = Long.parseLong(as[2]);
		long b = Long.parseLong(as[1]);
		long p = n %(a+b);
		if(p > b ) {p = b;}
		System.out.println((n/(a+b))*b + p);
	}

} public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] as = br.readLine().split(" ");
		long n = Long.parseLong(as[0]);
		long a = Long.parseLong(as[2]);
		long b = Long.parseLong(as[1]);
		long p = n %(a+b);
		if(p > b ) {p = b;}
		System.out.println((n/(a+b))*b + p);
	}

} Main


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] as = br.readLine().split(" ");
		long n = Long.parseLong(as[0]);
		long a = Long.parseLong(as[2]);
		long b = Long.parseLong(as[1]);
		long p = n %(a+b);
		if(p > b ) {p = b;}
		System.out.println((n/(a+b))*b + p);
	}

}
