parameters = input()
parameters = parameters.split()
m = int(parameters[0])
n = int(parameters[1])
k = int(parameters[2])
if k<0 or n<0 or m<0:
    print("Error!")
if k>1000000000 or n>1000000000 or m>1000000000:
    print("Error!")
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)