#!/usr/bin/env python3 import re;print(sum(int(re.search("\d",l)[0]+re.search("\d",l[::-1])[0])for l in open("input.txt")))