#!/usr/bin/perl -w

use v5.38;
use strict;
use experimental 'multidimensional', 'for_list', 'builtin';

my $sum;

while (<>) {
	my ($first) = /(\d)/;
	my ($last) = /.*(\d)/;
	$sum += "$first$last";
	# say "$first $last.";
}

say $sum;
