parameters = input()
parameters = parameters.split()
m = long(parameters[0])
n = long(parameters[1])
k = long(parameters[2])
horiz_lamps = m // k
vertic_lamps = n // k
lamps_left = 0
if m%k != 0:
    lamps_left  += vertic_lamps
elif n%k != 0:
    lamps_left += horiz_lamps
elif m%k != 0 and n%k != 0:
    lamps_left = lamps_left - 1
lamps_total = horiz_lamps * vertic_lamps + lamps_left
print(lamps_total)