#!/bin/python3 import re import sys input_f = sys.argv[1] count = 0 with open(input_f) as file: for line in file: x=re.findall('\d{1}',line.rstrip()) count = count + int(x[0] + x[len(x)-1]) print(count)