#include using namespace std; using ll = long long; int main() { ll h, a; cin >> h >> a; int count=0; while(true) { h=h/a; if(h>0) { count++; } else { count++; break; } } ll ans=0; for(ll i=1; i<=count; i++) { ans+=i; } cout << ans << endl; }