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 total=a+b;

    long am=n%total;

    long ans;

    if (am>a) {
      ans=n/total*a+a;
    }else{
      ans=n/total*a+am;
    }

    System.out.println(ans);
  }
} 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 total=a+b;

    long am=n%total;

    long ans;

    if (am>a) {
      ans=n/total*a+a;
    }else{
      ans=n/total*a+am;
    }

    System.out.println(ans);
  }
} 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 total=a+b;

    long am=n%total;

    long ans;

    if (am>a) {
      ans=n/total*a+a;
    }else{
      ans=n/total*a+am;
    }

    System.out.println(ans);
  } main {
    Scanner sc=new Scanner(System.in);
    long n=sc.nextLong();
    long a=sc.nextLong();//青
    long b=sc.nextLong();//赤

    long total=a+b;

    long am=n%total;

    long ans;

    if (am>a) {
      ans=n/total*a+a;
    }else{
      ans=n/total*a+am;
    }

    System.out.println(ans);
  } 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 total=a+b; total a+b a b long am=n%total; am n%total n total long ans; ans if (am>a) {
      ans=n/total*a+a;
    }else{
      ans=n/total*a+am;
    } am>a am a {
      ans=n/total*a+a;
    } ans=n/total*a+a ans n/total*a+a n/total*a n/total n total a a {
      ans=n/total*a+am;
    } ans=n/total*a+am ans n/total*a+am n/total*a n/total n total a am System.out.println(ans) System.out.println System.out System System.out ans 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 total=a+b;

    long am=n%total;

    long ans;

    if (am>a) {
      ans=n/total*a+a;
    }else{
      ans=n/total*a+am;
    }

    System.out.println(ans);
  }
} 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 total=a+b;

    long am=n%total;

    long ans;

    if (am>a) {
      ans=n/total*a+a;
    }else{
      ans=n/total*a+am;
    }

    System.out.println(ans);
  }
} 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 total=a+b;

    long am=n%total;

    long ans;

    if (am>a) {
      ans=n/total*a+a;
    }else{
      ans=n/total*a+am;
    }

    System.out.println(ans);
  }
}
