#include <iostream>
using namespace std;
int main(){
  int d,l;
  cin >>d>>l;
  int lcount =d/l;
  int num=d-lcount*l;
  if(num!=0){
    cout << num+lcount<<endl;
  }else cout <<lcount<<endl;
  return 0;
}