def calculate_lamps_needed(m, n, k):

    lamps_in_row = m // k
    lamps_in_column = n // k
    
   
    total_lamps = lamps_in_row * lamps_in_column
    
  
    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


m = int(input())  
n = int(input())    
k = int(input())    


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.")
