def compressAln(inStr):
    """ replace consecutive dots with count of dots 
    >>> compressAln("...AC...T...")
    '3AC3T3'
    """
    outStr = []
    stretchLen = -1
    for i, c in enumerate(inStr):
        if c!=".":
            if stretchLen!=-1:
                outStr.append(str(stretchLen))
            start = i
            outStr.append(c)
            stretchLen = -1
        else:
            if stretchLen==-1:
                stretchLen=0
            stretchLen+=1
    if stretchLen!=-1:
        outStr.append(str(stretchLen))
    return "".join(outStr)