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