n,m,k=map(int,input().split())
if (n%k==0) and (m%k==0):
    print((n*m)//(k**2))
elif (n%k==0) and (m%k!=0):
    nn=n//k
    mm=m//k+1
    print(nn*mm)
elif (n%k!=0) and (m%k==0):
    nn=n//k+1
    mm=m//k
    print(nn*mm)
else:
    nn=n//k+1
    mm=m//k+1
    print(nn*mm)
