def olcount(haystack, needle):
    """Count times the 2-character needle appears in haystack, including overlaps."""
    if needle[0] != needle[1]:
        return haystack.count(needle)
    return len([c0 for c0, c1 in zip(haystack[:-1], haystack[1:])
                if c0 == c1 == needle[0]])