#include <iostream>
using namespace std;

int main()
{
  int D,L;
  int cnt = 0;

  cin >> D >> L;

  if(D % L == 0)
    {
      cnt = D/L;
    }
  else
    {
      cnt = D/L + D%L;
    }
  cout << cnt << endl;
}

