def min_lamps_to_light(n, m, k):
    lamps_along_length = n // k
    lamps_along_width = m // k
    total_lamps = lamps_along_length * lamps_along_width

    if n % k != 0:
        total_lamps += lamps_along_width

    if m % k != 0:
        total_lamps += lamps_along_length

    if n % k != 0 and m % k != 0:
        total_lamps += 1

    return total_lamps


n, m, k = map(int, input().split())


result = min_lamps_to_light(n, m, k)
print(result)
