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 ans;

    long quo = n / (a + b);
    long rem = n % (a + b);
    if(rem > a){
      ans = (quo + 1) * a;
    } else {
      ans = quo * a + rem;
    }
    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 ans;

    long quo = n / (a + b);
    long rem = n % (a + b);
    if(rem > a){
      ans = (quo + 1) * a;
    } else {
      ans = quo * a + rem;
    }
    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 ans;

    long quo = n / (a + b);
    long rem = n % (a + b);
    if(rem > a){
      ans = (quo + 1) * a;
    } else {
      ans = quo * a + rem;
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long ans;

    long quo = n / (a + b);
    long rem = n % (a + b);
    if(rem > a){
      ans = (quo + 1) * a;
    } else {
      ans = quo * a + rem;
    }
    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 ans; ans long quo = n / (a + b); quo n / (a + b) n (a + b) a b long rem = n % (a + b); rem n % (a + b) n (a + b) a b if(rem > a){
      ans = (quo + 1) * a;
    } else {
      ans = quo * a + rem;
    } rem > a rem a {
      ans = (quo + 1) * a;
    } ans = (quo + 1) * a ans (quo + 1) * a (quo + 1) quo 1 a {
      ans = quo * a + rem;
    } ans = quo * a + rem ans quo * a + rem quo * a quo a rem 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 ans;

    long quo = n / (a + b);
    long rem = n % (a + b);
    if(rem > a){
      ans = (quo + 1) * a;
    } else {
      ans = quo * a + rem;
    }
    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 ans;

    long quo = n / (a + b);
    long rem = n % (a + b);
    if(rem > a){
      ans = (quo + 1) * a;
    } else {
      ans = quo * a + rem;
    }
    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 ans;

    long quo = n / (a + b);
    long rem = n % (a + b);
    if(rem > a){
      ans = (quo + 1) * a;
    } else {
      ans = quo * a + rem;
    }
    System.out.println(ans);
  }
}
