m, n, k = map(int, input().split())
a=n//k
b=m//k
c=n%k
d=m%k
if c>0:
    c=1
if d>0:
    d=1
if c!=0 and d!=0:
    print(a*b+c*b+d*a+1)
elif n%k!=0 or m%k!=0:
    print(a*b+c*b+d*a)
else:
    print(a*b)