#! perl -w
use bigint;
$n=0;
$m=1;
while(defined($c=getc STDIN)){
    $n+=ord($c)*$m;
    $m*=256;
}
print "$n\n";
