def calculate_lamps_needed(m, n, k):
    # Calculate the number of lamps needed for each row and column
    lamps_in_row = m // k
    lamps_in_column = n // k
    
    # Calculate the total number of lamps
    total_lamps = lamps_in_row * lamps_in_column
    
    # Check for any remaining area that needs additional lamps
    remaining_rows = m % k
    remaining_columns = n % k
    
    if remaining_rows > 0:
        total_lamps += lamps_in_column
    
    if remaining_columns > 0:
        total_lamps += lamps_in_row
    
    if remaining_rows > 0 and remaining_columns > 0:
        total_lamps += 1
    
    return total_lamps

# Input values (replace with your own values)
m = int(input())  # Length of the square in meters
n = int(input())   # Width of the square in meters
k = int(input())   # Size of the lamp in meters

# Calculate the number of lamps needed
lamps_needed = calculate_lamps_needed(m, n, k)

print(f"To illuminate a {m}x{n} meter square with {k}x{k} meter lamps, the mayor needs to buy {lamps_needed} lamps.")
