def solve_captcha(line):
    """
    >>> solve_captcha('1122')
    3
    >>> solve_captcha('1111')
    4
    >>> solve_captcha('1234')
    0
    >>> solve_captcha('91212129')
    9
    """
    return sum(int(c) for i, c in enumerate(line) if line[i - 1] == c)