import java.util.Scanner;

public class Main {

  // 参考：https://atcoder.jp/contests/abc158/submissions/10591203
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    // longで入るね.
    // https://docs.oracle.com/javase/jp/13/docs/api/java.base/java/lang/Long.html
    // longに設定可能な最大値2**63-1を保持する定数。
    // log10(2) * 63 = 18.964
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long sho = n / (a + b);
    long amari = n % (a + b);
    if(amari > a){
      System.out.println(sho * a + a);
    }else {
      System.out.println(sho * a + amari);
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {

  // 参考：https://atcoder.jp/contests/abc158/submissions/10591203
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    // longで入るね.
    // https://docs.oracle.com/javase/jp/13/docs/api/java.base/java/lang/Long.html
    // longに設定可能な最大値2**63-1を保持する定数。
    // log10(2) * 63 = 18.964
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long sho = n / (a + b);
    long amari = n % (a + b);
    if(amari > a){
      System.out.println(sho * a + a);
    }else {
      System.out.println(sho * a + amari);
    }
  }
} Main // 参考：https://atcoder.jp/contests/abc158/submissions/10591203
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    // longで入るね.
    // https://docs.oracle.com/javase/jp/13/docs/api/java.base/java/lang/Long.html
    // longに設定可能な最大値2**63-1を保持する定数。
    // log10(2) * 63 = 18.964
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long sho = n / (a + b);
    long amari = n % (a + b);
    if(amari > a){
      System.out.println(sho * a + a);
    }else {
      System.out.println(sho * a + amari);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    // longで入るね.
    // https://docs.oracle.com/javase/jp/13/docs/api/java.base/java/lang/Long.html
    // longに設定可能な最大値2**63-1を保持する定数。
    // log10(2) * 63 = 18.964
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long sho = n / (a + b);
    long amari = n % (a + b);
    if(amari > a){
      System.out.println(sho * a + a);
    }else {
      System.out.println(sho * a + amari);
    }
  } 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 sho = n / (a + b); sho n / (a + b) n (a + b) a b long amari = n % (a + b); amari n % (a + b) n (a + b) a b if(amari > a){
      System.out.println(sho * a + a);
    }else {
      System.out.println(sho * a + amari);
    } amari > a amari a {
      System.out.println(sho * a + a);
    } System.out.println(sho * a + a) System.out.println System.out System System.out sho * a + a sho * a sho a a {
      System.out.println(sho * a + amari);
    } System.out.println(sho * a + amari) System.out.println System.out System System.out sho * a + amari sho * a sho a amari String[] args args public class Main {

  // 参考：https://atcoder.jp/contests/abc158/submissions/10591203
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    // longで入るね.
    // https://docs.oracle.com/javase/jp/13/docs/api/java.base/java/lang/Long.html
    // longに設定可能な最大値2**63-1を保持する定数。
    // log10(2) * 63 = 18.964
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long sho = n / (a + b);
    long amari = n % (a + b);
    if(amari > a){
      System.out.println(sho * a + a);
    }else {
      System.out.println(sho * a + amari);
    }
  }
} public class Main {

  // 参考：https://atcoder.jp/contests/abc158/submissions/10591203
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    // longで入るね.
    // https://docs.oracle.com/javase/jp/13/docs/api/java.base/java/lang/Long.html
    // longに設定可能な最大値2**63-1を保持する定数。
    // log10(2) * 63 = 18.964
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long sho = n / (a + b);
    long amari = n % (a + b);
    if(amari > a){
      System.out.println(sho * a + a);
    }else {
      System.out.println(sho * a + amari);
    }
  }
} Main
import java.util.Scanner;

public class Main {

  // 参考：https://atcoder.jp/contests/abc158/submissions/10591203
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    // longで入るね.
    // https://docs.oracle.com/javase/jp/13/docs/api/java.base/java/lang/Long.html
    // longに設定可能な最大値2**63-1を保持する定数。
    // log10(2) * 63 = 18.964
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long sho = n / (a + b);
    long amari = n % (a + b);
    if(amari > a){
      System.out.println(sho * a + a);
    }else {
      System.out.println(sho * a + amari);
    }
  }
}