#include <iostream>
using namespace std;

#include <string>
void _150() {
    int n;
    string s;
    cin >> n;
    cin >> s;

    int count = 0;
    for (int i = 0; i < s.size() - 2; ++i) {
        if (s.substr(i, 3) == "ABC") {
            count++;
        }
    }
    cout << count << endl;
}

void _151() {
    int n, k, m;
    cin >> n >> k >> m;
    int a[100];
    int goal = m * n;
    for (int i = 0; i < n - 1; ++i) {
        cin >> a[i];
        goal -= a[i];
    }

    if (goal > k) {
        cout << -1 << endl;
    } else {
        cout << max(goal, 0) << endl;
    }
}

void _152() {
    int a, b;
    cin >> a >> b;

    string result("");
    if (a < b) {
        for (int i = 0; i < b; ++i) {
            result += to_string(a);
        }
    } else {
        for (int i = 0; i < a; ++i) {
            result += to_string(b);
        }
    }
    cout << result << endl;
}

void _153() {
    long long h;
    int n, a;
    cin >> h >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        h -= a;
        if (h <=0) {
            cout << "Yes" << endl;
            return;
        }
    }
    cout << "No" << endl;
    return;
}

void _154() {
    string s;
    cin >> s;

    for (int i = 0; i < s.size(); ++i) {
        cout << 'x';
    }
    cout << endl;
}

void _155() {
    int n, a;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        if (a % 2 == 0) {
            if ((a % 3 != 0) && (a % 5 != 0)) {
                cout <<"DENIED" << endl;
                return;
            }
        }
    }

    cout << "APPROVED" << endl;
}

#include <cmath>
void _156() {
    int n, k;
    cin >> n >> k;

    for (int i = 0; ; ++i) {
        if (pow(k, i) > n) {
            cout << i << endl;
            return;
        }
    }
}

#include <cstring>
void _157() {
    int a[3][3];
    int n;
    int b[10];
    for (int i = 0; i < 3; ++i)
        for (int j = 0; j < 3; ++j)
            cin >> a[i][j];
    cin >> n;
    for (int i = 0; i < n; ++i) 
        cin >> b[i];
    
    int judge[3][3];
    memset(judge, 0, sizeof(judge));
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            for (int k = 0; k < n; ++k) {
                if (a[i][j] == b[k]){
                    judge[i][j] = 1;
                    break;
                }
            }
        }
    }

    for (int i = 0; i < 3; ++i) {
        if (judge[i][0] == 1 && judge[i][1] == 1 && judge[i][2] == 1) {
            cout << "Yes" << endl;
            return;
        } else if (judge[0][i] == 1 && judge[1][i] == 1 && judge[2][i] == 1) {
            cout << "Yes" << endl;
            return;
        }
    }
    if (judge[0][0] == 1 && judge[1][1] == 1 && judge[2][2] == 1) {
        cout << "Yes" << endl;
        return;
    } else if (judge[0][2] == 1 && judge[1][1] == 1 && judge[2][0] == 1) {
        cout << "Yes" << endl;
        return;
    }

    cout << "No" << endl;
}

void _158() {
    long long n, a, b;
    cin >> n >> a >> b;

    long long times = n / (a + b);
    long long residual = n % (a + b);

    if (residual > a) {
        cout << times * a + a << endl;
    } else {
        cout << times * a + residual << endl;
    }
}

int main()
{
    _158();
    return 0;
}



Measured memory_bytes: 256