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