def howManyAtStart(text, string):
    """ how many times a (sub)string appears at start of text """
    pos = 0
    n = 0
    length = len(string)
    while text[pos:].startswith(string):
        pos += length
        n += 1
    return n
