def greatest_prod_vert(grid, n):
    """ Calculate the greatest product of `n` vertically consecutive numbers. """
    lower_limit = len(grid) - n
    max_prod = 0
    for x in range(n):
        for y in range(lower_limit):
            prod = 1
            for i in range(n):
                prod *= grid[x][y + i]
            max_prod = max(max_prod, prod)
    return max_prod