def parse_input(file_name):
    return list(map(int, open(file_name).readline()))


def solve(data):
    sum = 0
    for i in range(len(data)):
        curr = data[i]
        next = data[i + 1 if i + 1 < len(data) else -1]
        if curr == next:
            sum += curr
    return sum


file_input = parse_input('input')
print(file_input)
print(solve(file_input))

1839352a8fdc93ad56198b9080c12afadbfca261
<mask token>

<mask token>


def solve(data):
    sum = 0
    for i in range(len(data)):
        curr = data[i]
        next = data[i + 1 if i + 1 < len(data) else -1]
        if curr == next:
            sum += curr
    return sum


<mask token>

def parse_input(file_name):
    return list(map(int, open(file_name).readline()))


def solve(data):
    sum = 0
    for i in range(len(data)):
        curr = data[i]
        next = data[i + 1 if i + 1 < len(data) else -1]
        if curr == next:
            sum += curr
    return sum


<mask token>

def parse_input(file_name):
    return list(map(int, open(file_name).readline()))


def solve(data):
    sum = 0
    for i in range(len(data)):
        curr = data[i]
        next = data[i + 1 if i + 1 < len(data) else -1]
        if curr == next:
            sum += curr
    return sum


<mask token>
print(file_input)
print(solve(file_input))

def parse_input(file_name):
    return list(map(int, open(file_name).readline()))


def solve(data):
    sum = 0
    for i in range(len(data)):
        curr = data[i]
        next = data[i + 1 if i + 1 < len(data) else -1]
        if curr == next:
            sum += curr
    return sum


file_input = parse_input('input')
print(file_input)
print(solve(file_input))
