""" day_01_01.py """

# usage: python3 day_01_01.py


def get(filename):
    """ contents of filename """
    with open(filename, 'r', encoding='utf-8') as infile:
        data = infile.read().strip()

    return data


def test(data, given_solution):
    """ testing """
    assert solve(data) == given_solution


def solve(data):
    """ solve the puzzle """
    zero_count = 0
    dial = 50

    for rotation in data.split():
        clicks = int(rotation[1:])

        if rotation[0].lower() == 'l':
            clicks = -clicks

        dial = (dial + clicks) % 100

        if dial == 0:
            zero_count += 1

    return zero_count


if __name__ == '__main__':
    test(get('example01'), 3)

    puzzle = get('input')
    solution = solve(puzzle)

    print(solution)
