def min_attacks_to_defeat_slime(H, a): # Base case: if the strength of the slime is less than or equal to 0, no attack needed if H <= 0: return 0 # Recursively attack two new slimes with health H//a return 1 + min(min_attacks_to_defeat_slime(H // a, a), min_attacks_to_defeat_slime(H // a + (H % a), a)) H,a = map(int,input().split()) result = min_attacks_to_defeat_slime(H, a) print("Minimum attacks to defeat a slime with strength", H, ":", result)