def meh2(captcha):
    """Returns the sum of the digits which match the next one in the captcha
    input string.

    >>> meh2('1212')
    6
    >>> meh2('1221')
    0
    >>> meh2('123425')
    4
    >>> meh2('123123')
    12
    >>> meh2('12131415')
    4
    """
    result = 0
    for n in range(len(captcha)):
        if captcha[n] == captcha[(n + len(captcha) / 2) % len(captcha)]:
            result += int(captcha[n])
    return result