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 cnt = n / (a + b) * a;
      n %= (a + b);
      cnt += Math.min(a, n);
      System.out.println(cnt);
  }
} 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 cnt = n / (a + b) * a;
      n %= (a + b);
      cnt += Math.min(a, n);
      System.out.println(cnt);
  }
} 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 cnt = n / (a + b) * a;
      n %= (a + b);
      cnt += Math.min(a, n);
      System.out.println(cnt);
  } main { 
      Scanner sc = new Scanner(System.in);
      long n = sc.nextLong();
      long a = sc.nextLong();
      long b = sc.nextLong();

      long cnt = n / (a + b) * a;
      n %= (a + b);
      cnt += Math.min(a, n);
      System.out.println(cnt);
  } 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 cnt = n / (a + b) * a; cnt n / (a + b) * a n / (a + b) n (a + b) a b a n %= (a + b) n (a + b) a b cnt += Math.min(a, n) cnt Math.min(a, n) Math.min Math a n System.out.println(cnt) System.out.println System.out System System.out cnt 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 cnt = n / (a + b) * a;
      n %= (a + b);
      cnt += Math.min(a, n);
      System.out.println(cnt);
  }
} 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 cnt = n / (a + b) * a;
      n %= (a + b);
      cnt += Math.min(a, n);
      System.out.println(cnt);
  }
} 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 cnt = n / (a + b) * a;
      n %= (a + b);
      cnt += Math.min(a, n);
      System.out.println(cnt);
  }
}