import java.io.*;
import java.util.Scanner;
 
public class Main {
 
  public static void main(String[] args) {
 
    try {
      // 標準入力受け取り
      Scanner scan = new Scanner(System.in);      
      Long sum      = Long.parseLong(scan.next());
      Long blue     = Long.parseLong(scan.next());
      Long red      = Long.parseLong(scan.next());
      Long result   = sum/(blue+red)*blue;
      
      // 「合計と青+赤の余り」と「青いボールの数」を比較し、小さい数を加算
      result += Math.min(sum%(blue+red), blue);

      System.out.println(result);
      
    } catch (Exception e) {     
      System.out.print("error");
    }
  }
} import java.io.*; io.* java import java.util.Scanner; Scanner java.util public class Main {
 
  public static void main(String[] args) {
 
    try {
      // 標準入力受け取り
      Scanner scan = new Scanner(System.in);      
      Long sum      = Long.parseLong(scan.next());
      Long blue     = Long.parseLong(scan.next());
      Long red      = Long.parseLong(scan.next());
      Long result   = sum/(blue+red)*blue;
      
      // 「合計と青+赤の余り」と「青いボールの数」を比較し、小さい数を加算
      result += Math.min(sum%(blue+red), blue);

      System.out.println(result);
      
    } catch (Exception e) {     
      System.out.print("error");
    }
  }
} Main public static void main(String[] args) {
 
    try {
      // 標準入力受け取り
      Scanner scan = new Scanner(System.in);      
      Long sum      = Long.parseLong(scan.next());
      Long blue     = Long.parseLong(scan.next());
      Long red      = Long.parseLong(scan.next());
      Long result   = sum/(blue+red)*blue;
      
      // 「合計と青+赤の余り」と「青いボールの数」を比較し、小さい数を加算
      result += Math.min(sum%(blue+red), blue);

      System.out.println(result);
      
    } catch (Exception e) {     
      System.out.print("error");
    }
  } main {
 
    try {
      // 標準入力受け取り
      Scanner scan = new Scanner(System.in);      
      Long sum      = Long.parseLong(scan.next());
      Long blue     = Long.parseLong(scan.next());
      Long red      = Long.parseLong(scan.next());
      Long result   = sum/(blue+red)*blue;
      
      // 「合計と青+赤の余り」と「青いボールの数」を比較し、小さい数を加算
      result += Math.min(sum%(blue+red), blue);

      System.out.println(result);
      
    } catch (Exception e) {     
      System.out.print("error");
    }
  } try {
      // 標準入力受け取り
      Scanner scan = new Scanner(System.in);      
      Long sum      = Long.parseLong(scan.next());
      Long blue     = Long.parseLong(scan.next());
      Long red      = Long.parseLong(scan.next());
      Long result   = sum/(blue+red)*blue;
      
      // 「合計と青+赤の余り」と「青いボールの数」を比較し、小さい数を加算
      result += Math.min(sum%(blue+red), blue);

      System.out.println(result);
      
    } catch (Exception e) {     
      System.out.print("error");
    } catch (Exception e) {     
      System.out.print("error");
    } Exception e {     
      System.out.print("error");
    } System.out.print("error") System.out.print System.out System System.out "error" {
      // 標準入力受け取り
      Scanner scan = new Scanner(System.in);      
      Long sum      = Long.parseLong(scan.next());
      Long blue     = Long.parseLong(scan.next());
      Long red      = Long.parseLong(scan.next());
      Long result   = sum/(blue+red)*blue;
      
      // 「合計と青+赤の余り」と「青いボールの数」を比較し、小さい数を加算
      result += Math.min(sum%(blue+red), blue);

      System.out.println(result);
      
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) Long sum      = Long.parseLong(scan.next()); sum Long.parseLong(scan.next()) Long.parseLong Long scan.next() scan.next scan Long blue     = Long.parseLong(scan.next()); blue Long.parseLong(scan.next()) Long.parseLong Long scan.next() scan.next scan Long red      = Long.parseLong(scan.next()); red Long.parseLong(scan.next()) Long.parseLong Long scan.next() scan.next scan Long result   = sum/(blue+red)*blue; result sum/(blue+red)*blue sum/(blue+red) sum (blue+red) blue red blue result += Math.min(sum%(blue+red), blue) result Math.min(sum%(blue+red), blue) Math.min Math sum%(blue+red) sum (blue+red) blue red blue 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) {
 
    try {
      // 標準入力受け取り
      Scanner scan = new Scanner(System.in);      
      Long sum      = Long.parseLong(scan.next());
      Long blue     = Long.parseLong(scan.next());
      Long red      = Long.parseLong(scan.next());
      Long result   = sum/(blue+red)*blue;
      
      // 「合計と青+赤の余り」と「青いボールの数」を比較し、小さい数を加算
      result += Math.min(sum%(blue+red), blue);

      System.out.println(result);
      
    } catch (Exception e) {     
      System.out.print("error");
    }
  }
} public class Main {
 
  public static void main(String[] args) {
 
    try {
      // 標準入力受け取り
      Scanner scan = new Scanner(System.in);      
      Long sum      = Long.parseLong(scan.next());
      Long blue     = Long.parseLong(scan.next());
      Long red      = Long.parseLong(scan.next());
      Long result   = sum/(blue+red)*blue;
      
      // 「合計と青+赤の余り」と「青いボールの数」を比較し、小さい数を加算
      result += Math.min(sum%(blue+red), blue);

      System.out.println(result);
      
    } catch (Exception e) {     
      System.out.print("error");
    }
  }
} Main
import java.io.*;
import java.util.Scanner;
 
public class Main {
 
  public static void main(String[] args) {
 
    try {
      // 標準入力受け取り
      Scanner scan = new Scanner(System.in);      
      Long sum      = Long.parseLong(scan.next());
      Long blue     = Long.parseLong(scan.next());
      Long red      = Long.parseLong(scan.next());
      Long result   = sum/(blue+red)*blue;
      
      // 「合計と青+赤の余り」と「青いボールの数」を比較し、小さい数を加算
      result += Math.min(sum%(blue+red), blue);

      System.out.println(result);
      
    } catch (Exception e) {     
      System.out.print("error");
    }
  }
}