import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		B solver = new B();
		solver.solve(1, in, out);
		out.close();
	}

	static class B {
		public void solve(int testNumber, Scanner in, PrintWriter out) {
			long n = in.nextLong(), a = in.nextLong(), b = in.nextLong();
			long blue = 0;

			//		if(a != 0 && b != 0) {
			//            while (n > 0) {
			//                if (n >= a) {
			//                    blue += a;
			//                } else {
			//                    blue += n;
			//                }
			//
			//                n -= (a + b);
			//
			//            }
			//        }

			blue += n / (a + b) * a;

			long amari = n % (a + b);
			if (amari > 0) {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			}

			out.println(blue);
		}

	}
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		B solver = new B();
		solver.solve(1, in, out);
		out.close();
	}

	static class B {
		public void solve(int testNumber, Scanner in, PrintWriter out) {
			long n = in.nextLong(), a = in.nextLong(), b = in.nextLong();
			long blue = 0;

			//		if(a != 0 && b != 0) {
			//            while (n > 0) {
			//                if (n >= a) {
			//                    blue += a;
			//                } else {
			//                    blue += n;
			//                }
			//
			//                n -= (a + b);
			//
			//            }
			//        }

			blue += n / (a + b) * a;

			long amari = n % (a + b);
			if (amari > 0) {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			}

			out.println(blue);
		}

	}
} Main public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		B solver = new B();
		solver.solve(1, in, out);
		out.close();
	} main {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		B solver = new B();
		solver.solve(1, in, out);
		out.close();
	} InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) B solver = new B(); solver new B() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class B {
		public void solve(int testNumber, Scanner in, PrintWriter out) {
			long n = in.nextLong(), a = in.nextLong(), b = in.nextLong();
			long blue = 0;

			//		if(a != 0 && b != 0) {
			//            while (n > 0) {
			//                if (n >= a) {
			//                    blue += a;
			//                } else {
			//                    blue += n;
			//                }
			//
			//                n -= (a + b);
			//
			//            }
			//        }

			blue += n / (a + b) * a;

			long amari = n % (a + b);
			if (amari > 0) {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			}

			out.println(blue);
		}

	} B public void solve(int testNumber, Scanner in, PrintWriter out) {
			long n = in.nextLong(), a = in.nextLong(), b = in.nextLong();
			long blue = 0;

			//		if(a != 0 && b != 0) {
			//            while (n > 0) {
			//                if (n >= a) {
			//                    blue += a;
			//                } else {
			//                    blue += n;
			//                }
			//
			//                n -= (a + b);
			//
			//            }
			//        }

			blue += n / (a + b) * a;

			long amari = n % (a + b);
			if (amari > 0) {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			}

			out.println(blue);
		} solve {
			long n = in.nextLong(), a = in.nextLong(), b = in.nextLong();
			long blue = 0;

			//		if(a != 0 && b != 0) {
			//            while (n > 0) {
			//                if (n >= a) {
			//                    blue += a;
			//                } else {
			//                    blue += n;
			//                }
			//
			//                n -= (a + b);
			//
			//            }
			//        }

			blue += n / (a + b) * a;

			long amari = n % (a + b);
			if (amari > 0) {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			}

			out.println(blue);
		} long n = in.nextLong() n in.nextLong() in.nextLong in a = in.nextLong() a in.nextLong() in.nextLong in b = in.nextLong(); b in.nextLong() in.nextLong in long blue = 0; blue 0 blue += n / (a + b) * a blue n / (a + b) * a n / (a + b) n (a + b) a b a long amari = n % (a + b); amari n % (a + b) n (a + b) a b if (amari > 0) {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			} amari > 0 amari 0 {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			} if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				} amari >= a amari a {
					blue += a;
				} blue += a blue a {
					blue += amari;
				} blue += amari blue amari out.println(blue) out.println out blue int testNumber testNumber Scanner in in PrintWriter out out public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		B solver = new B();
		solver.solve(1, in, out);
		out.close();
	}

	static class B {
		public void solve(int testNumber, Scanner in, PrintWriter out) {
			long n = in.nextLong(), a = in.nextLong(), b = in.nextLong();
			long blue = 0;

			//		if(a != 0 && b != 0) {
			//            while (n > 0) {
			//                if (n >= a) {
			//                    blue += a;
			//                } else {
			//                    blue += n;
			//                }
			//
			//                n -= (a + b);
			//
			//            }
			//        }

			blue += n / (a + b) * a;

			long amari = n % (a + b);
			if (amari > 0) {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			}

			out.println(blue);
		}

	}
} public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		B solver = new B();
		solver.solve(1, in, out);
		out.close();
	}

	static class B {
		public void solve(int testNumber, Scanner in, PrintWriter out) {
			long n = in.nextLong(), a = in.nextLong(), b = in.nextLong();
			long blue = 0;

			//		if(a != 0 && b != 0) {
			//            while (n > 0) {
			//                if (n >= a) {
			//                    blue += a;
			//                } else {
			//                    blue += n;
			//                }
			//
			//                n -= (a + b);
			//
			//            }
			//        }

			blue += n / (a + b) * a;

			long amari = n % (a + b);
			if (amari > 0) {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			}

			out.println(blue);
		}

	}
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		B solver = new B();
		solver.solve(1, in, out);
		out.close();
	}

	static class B {
		public void solve(int testNumber, Scanner in, PrintWriter out) {
			long n = in.nextLong(), a = in.nextLong(), b = in.nextLong();
			long blue = 0;

			//		if(a != 0 && b != 0) {
			//            while (n > 0) {
			//                if (n >= a) {
			//                    blue += a;
			//                } else {
			//                    blue += n;
			//                }
			//
			//                n -= (a + b);
			//
			//            }
			//        }

			blue += n / (a + b) * a;

			long amari = n % (a + b);
			if (amari > 0) {
				if (amari >= a) {
					blue += a;
				} else {
					blue += amari;
				}
			}

			out.println(blue);
		}

	}
}

