import java.util.Scanner;

public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    String strFront = sc.next();
    String strBlue = sc.next();
    String strRed = sc.next();
    long Front = Long.parseLong(strFront);
    long Blue = Long.parseLong(strBlue);
    long Red = Long.parseLong(strRed);
    
    if(Blue == 0) {
    	System.out.println(0);
    	return;
    }
    long cycle = Front / (Blue + Red);
    long remainder = Front % (Blue + Red);
    if(remainder > Blue) {
    	remainder = Blue;
    }
    
    System.out.println(cycle * Blue + remainder);

}
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    String strFront = sc.next();
    String strBlue = sc.next();
    String strRed = sc.next();
    long Front = Long.parseLong(strFront);
    long Blue = Long.parseLong(strBlue);
    long Red = Long.parseLong(strRed);
    
    if(Blue == 0) {
    	System.out.println(0);
    	return;
    }
    long cycle = Front / (Blue + Red);
    long remainder = Front % (Blue + Red);
    if(remainder > Blue) {
    	remainder = Blue;
    }
    
    System.out.println(cycle * Blue + remainder);

}
} Main public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    String strFront = sc.next();
    String strBlue = sc.next();
    String strRed = sc.next();
    long Front = Long.parseLong(strFront);
    long Blue = Long.parseLong(strBlue);
    long Red = Long.parseLong(strRed);
    
    if(Blue == 0) {
    	System.out.println(0);
    	return;
    }
    long cycle = Front / (Blue + Red);
    long remainder = Front % (Blue + Red);
    if(remainder > Blue) {
    	remainder = Blue;
    }
    
    System.out.println(cycle * Blue + remainder);

} main {
    Scanner sc = new Scanner(System.in);
    String strFront = sc.next();
    String strBlue = sc.next();
    String strRed = sc.next();
    long Front = Long.parseLong(strFront);
    long Blue = Long.parseLong(strBlue);
    long Red = Long.parseLong(strRed);
    
    if(Blue == 0) {
    	System.out.println(0);
    	return;
    }
    long cycle = Front / (Blue + Red);
    long remainder = Front % (Blue + Red);
    if(remainder > Blue) {
    	remainder = Blue;
    }
    
    System.out.println(cycle * Blue + remainder);

} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String strFront = sc.next(); strFront sc.next() sc.next sc String strBlue = sc.next(); strBlue sc.next() sc.next sc String strRed = sc.next(); strRed sc.next() sc.next sc long Front = Long.parseLong(strFront); Front Long.parseLong(strFront) Long.parseLong Long strFront long Blue = Long.parseLong(strBlue); Blue Long.parseLong(strBlue) Long.parseLong Long strBlue long Red = Long.parseLong(strRed); Red Long.parseLong(strRed) Long.parseLong Long strRed if(Blue == 0) {
    	System.out.println(0);
    	return;
    } Blue == 0 Blue 0 {
    	System.out.println(0);
    	return;
    } System.out.println(0) System.out.println System.out System System.out 0 return; long cycle = Front / (Blue + Red); cycle Front / (Blue + Red) Front (Blue + Red) Blue Red long remainder = Front % (Blue + Red); remainder Front % (Blue + Red) Front (Blue + Red) Blue Red if(remainder > Blue) {
    	remainder = Blue;
    } remainder > Blue remainder Blue {
    	remainder = Blue;
    } remainder = Blue remainder Blue System.out.println(cycle * Blue + remainder) System.out.println System.out System System.out cycle * Blue + remainder cycle * Blue cycle Blue remainder String[] args args public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    String strFront = sc.next();
    String strBlue = sc.next();
    String strRed = sc.next();
    long Front = Long.parseLong(strFront);
    long Blue = Long.parseLong(strBlue);
    long Red = Long.parseLong(strRed);
    
    if(Blue == 0) {
    	System.out.println(0);
    	return;
    }
    long cycle = Front / (Blue + Red);
    long remainder = Front % (Blue + Red);
    if(remainder > Blue) {
    	remainder = Blue;
    }
    
    System.out.println(cycle * Blue + remainder);

}
} public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    String strFront = sc.next();
    String strBlue = sc.next();
    String strRed = sc.next();
    long Front = Long.parseLong(strFront);
    long Blue = Long.parseLong(strBlue);
    long Red = Long.parseLong(strRed);
    
    if(Blue == 0) {
    	System.out.println(0);
    	return;
    }
    long cycle = Front / (Blue + Red);
    long remainder = Front % (Blue + Red);
    if(remainder > Blue) {
    	remainder = Blue;
    }
    
    System.out.println(cycle * Blue + remainder);

}
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    String strFront = sc.next();
    String strBlue = sc.next();
    String strRed = sc.next();
    long Front = Long.parseLong(strFront);
    long Blue = Long.parseLong(strBlue);
    long Red = Long.parseLong(strRed);
    
    if(Blue == 0) {
    	System.out.println(0);
    	return;
    }
    long cycle = Front / (Blue + Red);
    long remainder = Front % (Blue + Red);
    if(remainder > Blue) {
    	remainder = Blue;
    }
    
    System.out.println(cycle * Blue + remainder);

}
}