def sam_count(l):
    """ Count how many words are in a list up to the word sam. """
    num = 0
    for name in l:
        if name == "sam":
            num += 1
            break
        else:
            num += 1
    return num