import java.util.Scanner;

/**
 * Created 2017/05/25.
 * nextLineの挙動とか
 */
public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      long N = sc.nextLong();
      long b = sc.nextLong();
      long r = sc.nextLong();
     
      long s = b+r;
      long cnt = N / s;
      long mod = N % s;
      long p = Math.min(mod,b);
      long sum = b * cnt;
      long result = sum + p;
     System.out.println(result);
   }
} import java.util.Scanner; Scanner java.util public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      long N = sc.nextLong();
      long b = sc.nextLong();
      long r = sc.nextLong();
     
      long s = b+r;
      long cnt = N / s;
      long mod = N % s;
      long p = Math.min(mod,b);
      long sum = b * cnt;
      long result = sum + p;
     System.out.println(result);
   }
} Main public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      long N = sc.nextLong();
      long b = sc.nextLong();
      long r = sc.nextLong();
     
      long s = b+r;
      long cnt = N / s;
      long mod = N % s;
      long p = Math.min(mod,b);
      long sum = b * cnt;
      long result = sum + p;
     System.out.println(result);
   } main {
      Scanner sc = new Scanner(System.in);
      long N = sc.nextLong();
      long b = sc.nextLong();
      long r = sc.nextLong();
     
      long s = b+r;
      long cnt = N / s;
      long mod = N % s;
      long p = Math.min(mod,b);
      long sum = b * cnt;
      long result = sum + p;
     System.out.println(result);
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long r = sc.nextLong(); r sc.nextLong() sc.nextLong sc long s = b+r; s b+r b r long cnt = N / s; cnt N / s N s long mod = N % s; mod N % s N s long p = Math.min(mod,b); p Math.min(mod,b) Math.min Math mod b long sum = b * cnt; sum b * cnt b cnt long result = sum + p; result sum + p sum p System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      long N = sc.nextLong();
      long b = sc.nextLong();
      long r = sc.nextLong();
     
      long s = b+r;
      long cnt = N / s;
      long mod = N % s;
      long p = Math.min(mod,b);
      long sum = b * cnt;
      long result = sum + p;
     System.out.println(result);
   }
} public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      long N = sc.nextLong();
      long b = sc.nextLong();
      long r = sc.nextLong();
     
      long s = b+r;
      long cnt = N / s;
      long mod = N % s;
      long p = Math.min(mod,b);
      long sum = b * cnt;
      long result = sum + p;
     System.out.println(result);
   }
} Main
import java.util.Scanner;

/**
 * Created 2017/05/25.
 * nextLineの挙動とか
 */
public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      long N = sc.nextLong();
      long b = sc.nextLong();
      long r = sc.nextLong();
     
      long s = b+r;
      long cnt = N / s;
      long mod = N % s;
      long p = Math.min(mod,b);
      long sum = b * cnt;
      long result = sum + p;
     System.out.println(result);
   }
}
