import java.util.Scanner;

public class Main
{
	public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long a = s.nextLong();
        long b = s.nextLong();
        long rep = a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b));
        System.out.println(rep);
	}
} import java.util.Scanner; Scanner java.util public class Main
{
	public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long a = s.nextLong();
        long b = s.nextLong();
        long rep = a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b));
        System.out.println(rep);
	}
} Main public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long a = s.nextLong();
        long b = s.nextLong();
        long rep = a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b));
        System.out.println(rep);
	} main {
	    Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long a = s.nextLong();
        long b = s.nextLong();
        long rep = a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b));
        System.out.println(rep);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) long n = s.nextLong(); n s.nextLong() s.nextLong s long a = s.nextLong(); a s.nextLong() s.nextLong s long b = s.nextLong(); b s.nextLong() s.nextLong s long rep = a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b)); rep a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b)) a * (n/(a+b)) a (n/(a+b)) n (a+b) a b (n%(a+b) > a ? a : n%(a+b)) n%(a+b) > a n%(a+b) n (a+b) a b a a n%(a+b) n (a+b) a b System.out.println(rep) System.out.println System.out System System.out rep String[] args args public class Main
{
	public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long a = s.nextLong();
        long b = s.nextLong();
        long rep = a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b));
        System.out.println(rep);
	}
} public class Main
{
	public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long a = s.nextLong();
        long b = s.nextLong();
        long rep = a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b));
        System.out.println(rep);
	}
} Main
import java.util.Scanner;

public class Main
{
	public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long a = s.nextLong();
        long b = s.nextLong();
        long rep = a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b));
        System.out.println(rep);
	}
}