def calculate_lamps(n, m, k):
    if n % k == 0 and m % k == 0:
        return (n*m)/(k*k)

    n_covered = n // k
    m_covered = m // k

    lamps = n_covered * m_covered

    if n % k != 0:
        lamps += m_covered

    if m % k != 0:
        lamps += n_covered

    if n % k != 0 and m % k != 0:
        lamps += 1

    return lamps


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

lamps_needed = calculate_lamps(n, m, k)

print(lamps_needed)