aoc2015/d01/part1.py

7 lines
84 B
Python

import sys
s = sys.stdin.read()[:-1]
print(sum(map(lambda c: [-1,1][c=='('],s)))