input: def max_empty(grid, capacity):
      import math
      """
      Given a grid representing several wells, each row denotes a well, with each 
      1 in the row indicating a unit of water.
      Use buckets with the same capacity to extract water from these wells.
      The goal is to determine the number of times the buckets must be used to empty all the wells.
  
      Example 1:
          Input: 
              grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]
              bucket_capacity : 1
          Output: 6
  
      Example 2:
          Input: 
              grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]
              bucket_capacity : 2
          Output: 5
      
      Example 3:
          Input: 
              grid : [[0,0,0], [0,0,0]]
              bucket_capacity : 5
          Output: 0
  
      Constraints:
          * all wells have equal lengths
          * 1 <= grid.length <= 100
          * 1 <= grid[0].length <= 100
          * grid[i][j] is either 0 or 1
          * 1 <= capacity <= 10
      """
output:     def max_empty(grid, capacity):
      import math
      total_units = 0
      
      for row in grid:
          total_units += row.count(1)
      
      return math.ceil(total_units / capacity)