import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long a = scan.nextLong();
    long b = scan.nextLong();
    long c = a+b;
    long d = n%c;
    if ((a == 0)||(c == 0)){
      System.out.println("0");
      return;
    }

    long g = (long) (n-d)/c;
    if (g == 0){
      if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      }
    }
    else{
      long other = 0;
      if (d<=a){
        other = d;
      }
      else{
        other = a;
      }
      System.out.println(g*a+other);
    }
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long a = scan.nextLong();
    long b = scan.nextLong();
    long c = a+b;
    long d = n%c;
    if ((a == 0)||(c == 0)){
      System.out.println("0");
      return;
    }

    long g = (long) (n-d)/c;
    if (g == 0){
      if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      }
    }
    else{
      long other = 0;
      if (d<=a){
        other = d;
      }
      else{
        other = a;
      }
      System.out.println(g*a+other);
    }
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long a = scan.nextLong();
    long b = scan.nextLong();
    long c = a+b;
    long d = n%c;
    if ((a == 0)||(c == 0)){
      System.out.println("0");
      return;
    }

    long g = (long) (n-d)/c;
    if (g == 0){
      if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      }
    }
    else{
      long other = 0;
      if (d<=a){
        other = d;
      }
      else{
        other = a;
      }
      System.out.println(g*a+other);
    }
  } main {
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long a = scan.nextLong();
    long b = scan.nextLong();
    long c = a+b;
    long d = n%c;
    if ((a == 0)||(c == 0)){
      System.out.println("0");
      return;
    }

    long g = (long) (n-d)/c;
    if (g == 0){
      if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      }
    }
    else{
      long other = 0;
      if (d<=a){
        other = d;
      }
      else{
        other = a;
      }
      System.out.println(g*a+other);
    }
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long n = scan.nextLong(); n scan.nextLong() scan.nextLong scan long a = scan.nextLong(); a scan.nextLong() scan.nextLong scan long b = scan.nextLong(); b scan.nextLong() scan.nextLong scan long c = a+b; c a+b a b long d = n%c; d n%c n c if ((a == 0)||(c == 0)){
      System.out.println("0");
      return;
    } (a == 0)||(c == 0) (a == 0) a 0 (c == 0) c 0 {
      System.out.println("0");
      return;
    } System.out.println("0") System.out.println System.out System System.out "0" return; long g = (long) (n-d)/c; g (long) (n-d)/c (long) (n-d) n d c if (g == 0){
      if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      }
    }
    else{
      long other = 0;
      if (d<=a){
        other = d;
      }
      else{
        other = a;
      }
      System.out.println(g*a+other);
    } g == 0 g 0 {
      if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      }
    } if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      } n<=a n a {
        System.out.println(n);
      } System.out.println(n) System.out.println System.out System System.out n {
        System.out.println(a);
      } System.out.println(a) System.out.println System.out System System.out a {
      long other = 0;
      if (d<=a){
        other = d;
      }
      else{
        other = a;
      }
      System.out.println(g*a+other);
    } long other = 0; other 0 if (d<=a){
        other = d;
      }
      else{
        other = a;
      } d<=a d a {
        other = d;
      } other = d other d {
        other = a;
      } other = a other a System.out.println(g*a+other) System.out.println System.out System System.out g*a+other g*a g a other String[] args args public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long a = scan.nextLong();
    long b = scan.nextLong();
    long c = a+b;
    long d = n%c;
    if ((a == 0)||(c == 0)){
      System.out.println("0");
      return;
    }

    long g = (long) (n-d)/c;
    if (g == 0){
      if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      }
    }
    else{
      long other = 0;
      if (d<=a){
        other = d;
      }
      else{
        other = a;
      }
      System.out.println(g*a+other);
    }
  }
} public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long a = scan.nextLong();
    long b = scan.nextLong();
    long c = a+b;
    long d = n%c;
    if ((a == 0)||(c == 0)){
      System.out.println("0");
      return;
    }

    long g = (long) (n-d)/c;
    if (g == 0){
      if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      }
    }
    else{
      long other = 0;
      if (d<=a){
        other = d;
      }
      else{
        other = a;
      }
      System.out.println(g*a+other);
    }
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long a = scan.nextLong();
    long b = scan.nextLong();
    long c = a+b;
    long d = n%c;
    if ((a == 0)||(c == 0)){
      System.out.println("0");
      return;
    }

    long g = (long) (n-d)/c;
    if (g == 0){
      if (n<=a){
        System.out.println(n);
      }
      else{
        System.out.println(a);
      }
    }
    else{
      long other = 0;
      if (d<=a){
        other = d;
      }
      else{
        other = a;
      }
      System.out.println(g*a+other);
    }
  }
}
