import java.util.*;

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 a = (N / (A + B) )* A;
    long b = N % (A + B);
    if (b >= A) {
      System.out.println(a + A);
    } else {
      System.out.println(a + b);
    }
  }
} import java.util.*; util.* 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 a = (N / (A + B) )* A;
    long b = N % (A + B);
    if (b >= A) {
      System.out.println(a + A);
    } else {
      System.out.println(a + b);
    }
  }
} 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 a = (N / (A + B) )* A;
    long b = N % (A + B);
    if (b >= A) {
      System.out.println(a + A);
    } else {
      System.out.println(a + b);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();
    long a = (N / (A + B) )* A;
    long b = N % (A + B);
    if (b >= A) {
      System.out.println(a + A);
    } else {
      System.out.println(a + b);
    }
  } 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 a = (N / (A + B) )* A; a (N / (A + B) )* A (N / (A + B) ) N (A + B) A B A long b = N % (A + B); b N % (A + B) N (A + B) A B if (b >= A) {
      System.out.println(a + A);
    } else {
      System.out.println(a + b);
    } b >= A b A {
      System.out.println(a + A);
    } System.out.println(a + A) System.out.println System.out System System.out a + A a A {
      System.out.println(a + b);
    } System.out.println(a + b) System.out.println System.out System System.out a + b a b 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 a = (N / (A + B) )* A;
    long b = N % (A + B);
    if (b >= A) {
      System.out.println(a + A);
    } else {
      System.out.println(a + b);
    }
  }
} 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 a = (N / (A + B) )* A;
    long b = N % (A + B);
    if (b >= A) {
      System.out.println(a + A);
    } else {
      System.out.println(a + b);
    }
  }
} Main
import java.util.*;

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 a = (N / (A + B) )* A;
    long b = N % (A + B);
    if (b >= A) {
      System.out.println(a + A);
    } else {
      System.out.println(a + b);
    }
  }
}