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


    long p = n/c;
    long q = n%c;

    if(q>a){
      q = a;
    }

    long ans = a * p + q;

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


    long p = n/c;
    long q = n%c;

    if(q>a){
      q = a;
    }

    long ans = a * p + q;

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


    long p = n/c;
    long q = n%c;

    if(q>a){
      q = a;
    }

    long ans = a * p + q;

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


    long p = n/c;
    long q = n%c;

    if(q>a){
      q = a;
    }

    long ans = a * p + q;

    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 c = a + b; c a + b a b long p = n/c; p n/c n c long q = n%c; q n%c n c if(q>a){
      q = a;
    } q>a q a {
      q = a;
    } q = a q a long ans = a * p + q; ans a * p + q a * p a p q 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 c = a + b;


    long p = n/c;
    long q = n%c;

    if(q>a){
      q = a;
    }

    long ans = a * p + q;

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


    long p = n/c;
    long q = n%c;

    if(q>a){
      q = a;
    }

    long ans = a * p + q;

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


    long p = n/c;
    long q = n%c;

    if(q>a){
      q = a;
    }

    long ans = a * p + q;

    System.out.println(ans);
  }
}