{
TASK:iban
LANG:Pascal
}
const b1=['0','1'..'9'];
      b2=['A'..'Z'];
var a:array[1..22]of string[2];
b:array[2..44]of string[1];
c:array[2..45]of shortint;
x:string[1];
x2:char;
s:string[22];
i,h,j,q,w,prenos:integer;
begin
readln(s);
for i:=1 to 22 do begin
x:=copy(s,i,1);
x2:=x[1];
if (x2 in b1) then begin
case x2 of
'0' : a[i]:='00';
'1' : a[i]:='01';
'2' : a[i]:='02';
'3' : a[i]:='03';
'4' : a[i]:='04';
'5' : a[i]:='05';
'6' : a[i]:='06';
'7' : a[i]:='07';
'8' : a[i]:='08';
'9' : a[i]:='09'; end; end;
if (x2 in b2) then begin
case x2 of
'A' : a[i]:='10';
'B' : a[i]:='11';
'C' : a[i]:='12';
'D' : a[i]:='13';
'E' : a[i]:='14';
'F' : a[i]:='15';
'G' : a[i]:='16';
'H' : a[i]:='17';
'I' : a[i]:='18';
'J' : a[i]:='19';
'K' : a[i]:='20';
'L' : a[i]:='21';
'M' : a[i]:='22';
'N' : a[i]:='23';
'O' : a[i]:='00';
'P' : a[i]:='25';
'Q' : a[i]:='26';
'R' : a[i]:='27';
'S' : a[i]:='28';
'T' : a[i]:='29';
'U' : a[i]:='30';
'V' : a[i]:='31';
'W' : a[i]:='32';
'X' : a[i]:='33';
'Y' : a[i]:='34';
'Z' : a[i]:='35'; end; end; end;
h:=0;
for i:=1 to 22 do
for j:=1 to 2 do begin h:=h+1; b[h]:=copy(a[i],j,1); end;
for i:=1 to 44 do begin val(b[i],q,w); c[i]:=q; end;
prenos:=0;
for i:=1 to 44 do begin
c[i]:=c[i]*11;
c[i]:=c[i]+prenos;
prenos:=c[i] div 10;
c[i]:=c[i] mod 10; end;
if prenos>0 then begin c[45]:=prenos; for i:=1 to 45 do write(c[i]); end
else for i:=1 to 44 do write(c[i]);
writeln;
readln;
end.


