
a, b, c = map(int, input().split())
x = a // c
y = b // c
res = x * y
b1 = True
b2 = True
if a % c != 0:
	res += c
	b1 = False
if b % c!= 0:
	res += c
	b2 = False
if not b1 and not b2:
	res += 1
print(res)