def minimum_lanterns(n, m, k):
    rows_lanterns = (n + k - 1) // k
    columns_lanterns = (m + k - 1) // k

    total_lanterns = rows_lanterns * columns_lanterns

    return total_lanterns

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

result = minimum_lanterns(n, m, k)
print(result)def minimum_lanterns(n, m, k):
    rows_lanterns = (n + k - 1) // k
    columns_lanterns = (m + k - 1) // k

    total_lanterns = rows_lanterns * columns_lanterns

    return total_lanterns

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

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