#include<bits/stdc++.h> using namespace std; int main(){ int n,k,m; cin>>n>>k; m=n/k; cout<<n+(n+m)/k; return 0; }