#!/usr/bin/python3 """Analyze callgrind.out.2603407, etc. Reports total number of calls..""" import sys, re print(sum(int(mo.group(1)) for line in sys.stdin for mo in [re.match(r'^calls=(\d+)', line)] if mo))