X= int(input()) Y= int(input()) L= int(input()) def move(X, Y, L): x_count= abs((X + L - 1) // L) y_count= abs((Y + L - 1) // L) return print(1+x_count+y_count) move(X, Y, L)