#!/usr/bin/perl -w

use v5.38;

chomp (my $line = <>);

my $sum;
for (split /,/, $line) {
	my $n = 0;
	for (split //) {
		$n += ord;
		$n *= 17;
		$n %= 256;
	}
	$sum += $n;
}
say $sum;

