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