#!/usr/bin/perl -w

use v5.36;
use strict;
use experimental 'multidimensional';

my $sum;
while (<>) {
	chomp;
	substr($_, length()/2, 0) = ' ';
	s/\A\S*(.)\S*\s\S*\1\S*\z/$1/;
	$sum += /[A-Z]/
		? ord() - ord('A') + 27
		: ord() - ord('a') + 1; 
}
say $sum;
