//https://onlinejudge.u-aizu.ac.jp/challenges/sources/PCK/Prelim/0317?year=2015

#include <bits/stdc++.h>

using namespace std;

int main() {
    int d, l;
    cin >> d >> l;

    cout << d / l + d % l << endl;
    return 0;
}

/*
 *
 */
