#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	ll n, a, b;
	scanf("%lld%lld%lld", &n, &a, &b);
	ll ans = n / (a + b) * a;
	if(n % (a + b)) ans += min(a, n % (a + b));
	printf("%lld\n", ans);
}