import java.util.*;
import java.lang.*;
import java.io.*;


public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer s = new StringTokenizer(br.readLine());
        long n = Long.parseLong(s.nextToken());
        long blue = Long.parseLong(s.nextToken());
        long red = Long.parseLong(s.nextToken());
        long periods = n / (blue + red);
        long totalBlue = blue * periods;
        System.out.println(totalBlue + Math.min(n % (blue + red), blue));
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer s = new StringTokenizer(br.readLine());
        long n = Long.parseLong(s.nextToken());
        long blue = Long.parseLong(s.nextToken());
        long red = Long.parseLong(s.nextToken());
        long periods = n / (blue + red);
        long totalBlue = blue * periods;
        System.out.println(totalBlue + Math.min(n % (blue + red), blue));
    }
} Main public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer s = new StringTokenizer(br.readLine());
        long n = Long.parseLong(s.nextToken());
        long blue = Long.parseLong(s.nextToken());
        long red = Long.parseLong(s.nextToken());
        long periods = n / (blue + red);
        long totalBlue = blue * periods;
        System.out.println(totalBlue + Math.min(n % (blue + red), blue));
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer s = new StringTokenizer(br.readLine());
        long n = Long.parseLong(s.nextToken());
        long blue = Long.parseLong(s.nextToken());
        long red = Long.parseLong(s.nextToken());
        long periods = n / (blue + red);
        long totalBlue = blue * periods;
        System.out.println(totalBlue + Math.min(n % (blue + red), blue));
    } BufferedReader br = new BufferedReader(new InputStreamReader((System.in))); br new BufferedReader(new InputStreamReader((System.in))) StringTokenizer s = new StringTokenizer(br.readLine()); s new StringTokenizer(br.readLine()) long n = Long.parseLong(s.nextToken()); n Long.parseLong(s.nextToken()) Long.parseLong Long s.nextToken() s.nextToken s long blue = Long.parseLong(s.nextToken()); blue Long.parseLong(s.nextToken()) Long.parseLong Long s.nextToken() s.nextToken s long red = Long.parseLong(s.nextToken()); red Long.parseLong(s.nextToken()) Long.parseLong Long s.nextToken() s.nextToken s long periods = n / (blue + red); periods n / (blue + red) n (blue + red) blue red long totalBlue = blue * periods; totalBlue blue * periods blue periods System.out.println(totalBlue + Math.min(n % (blue + red), blue)) System.out.println System.out System System.out totalBlue + Math.min(n % (blue + red), blue) totalBlue Math.min(n % (blue + red), blue) Math.min Math n % (blue + red) n (blue + red) blue red blue String[] args args public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer s = new StringTokenizer(br.readLine());
        long n = Long.parseLong(s.nextToken());
        long blue = Long.parseLong(s.nextToken());
        long red = Long.parseLong(s.nextToken());
        long periods = n / (blue + red);
        long totalBlue = blue * periods;
        System.out.println(totalBlue + Math.min(n % (blue + red), blue));
    }
} public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer s = new StringTokenizer(br.readLine());
        long n = Long.parseLong(s.nextToken());
        long blue = Long.parseLong(s.nextToken());
        long red = Long.parseLong(s.nextToken());
        long periods = n / (blue + red);
        long totalBlue = blue * periods;
        System.out.println(totalBlue + Math.min(n % (blue + red), blue));
    }
} Main
import java.util.*;
import java.lang.*;
import java.io.*;


public class Main {
    public static void main(String[] args) throws java.lang.Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader((System.in)));
        StringTokenizer s = new StringTokenizer(br.readLine());
        long n = Long.parseLong(s.nextToken());
        long blue = Long.parseLong(s.nextToken());
        long red = Long.parseLong(s.nextToken());
        long periods = n / (blue + red);
        long totalBlue = blue * periods;
        System.out.println(totalBlue + Math.min(n % (blue + red), blue));
    }
}