H , A = map(int,input().split()) ans = 1 for i in range (0,H): H = H // A ans = ans + 2 if H == 1: print(ans) break