def min_light(n, m, k):
    squares_by_length = (n + k - 1)//k
    squares_by_width = (m + k - 1)//k
    
    total_squares = squares_by_width * squares_by_length
    
    return total_squares
n, m, k = map(int, input().split())

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