23 lines
357 B
Python
Executable File
23 lines
357 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
|
|
position = 50
|
|
code = 0
|
|
|
|
for line in sys.stdin:
|
|
line = line.strip()
|
|
if line.startswith('L'):
|
|
position -= int(line[1:])
|
|
elif line.startswith('R'):
|
|
position += int(line[1:])
|
|
else:
|
|
raise Exception('weird line')
|
|
|
|
position %= 100
|
|
|
|
if not position:
|
|
code += 1
|
|
|
|
print(code)
|