program ippppp;
var 	zn: boolean;
	A: array[1..100,1..2] of integer;
	Vys, BVys, CVys: string(9);
	i, j: integer;
	slovo: string;

procedure Nacitaj;
var koniec: boolean;

begin
 i:=1; koniec:= false;

 repeat
   read(slovo);
   if slovo = 'negative' then zn:= true;
   if slovo = 'zero' then begin A[i,1]:= 0; A[i,2]:= 0; end;
   if slovo = 'one' then begin A[i,1]:= 1; A[i,2]:= 0; end;
   if slovo = 'two' then begin A[i,1]:= 2; A[i,2]:= 0; end;
   if slovo = 'three' then begin A[i,1]:= 3; A[i,2]:= 0; end;
   if slovo = 'four' then begin A[i,1]:= 4; A[i,2]:= 0; end;
   if slovo = 'five' then begin A[i,1]:= 5; A[i,2]:= 0; end;
   if slovo = 'six' then begin A[i,1]:= 6; A[i,2]:= 0; end;
   if slovo = 'seven' then begin A[i,1]:= 7; A[i,2]:= 0; end;
   if slovo = 'eight' then begin A[i,1]:= 8; A[i,2]:= 0; end;
   if slovo = 'nine' then begin A[i,1]:= 9; A[i,2]:= 0; end;
   if slovo = 'ten' then 
    begin A[i,1]:= 1; A[i,2]:= 1; inc(i); A[i,1]:= 0; A[i,2]:= 0; end;
   if slovo = 'eleven' then 
    begin A[i,1]:= 1; A[i,2]:= 1; inc(i); A[i,1]:= 1; A[i,2]:= 0; end;
   if slovo = 'twenty' then 
    begin A[i,1]:= 2; A[i,2]:= 1; inc(i); A[i,1]:= 0; A[i,2]:=0; end;
   if slovo = 'hundred' then begin A[i,1]:= 0; A[i,2]:= 2; end;
   if slovo = 'thousand' then begin A[i,1]:= 0; A[i,2]:= 3; end;
   if slovo = 'million' then begin A[i,1]:= 0; A[i,2]:= 6; end;
   if slovo = '' then koniec:= true;
 inc(i);
 until koniec;
 A[i,1]:= 9; A[i,2]:= 9;
end;

procedure Prevod;
begin
 if A[1,2] = 0 then 
  begin 
   Vys[1]:= char(A[1,1]+ord('0')); 
   BVys:=Vys; 
  end
		else
  begin
   Vys[1]:= char(A[2,2]+ord('0'));
   Vys[2]:= char(A[1,1]+ord('0'));
   exit; 
  end;

  i:=2;
  repeat
   if A[i,2] > A[i-1,2] then
    begin
     Vys:='';
     for j:=1 to A[i,2] do Vys[j]:='0';
     Vys:= BVys+Vys;
     BVys:= Vys;
     inc(i);
    end
			else
    begin
     if A[i,2]=0 then 
      begin
       Vys[length(Vys)]:= char(A[i,1]+ord('0'));
       BVys:= Vys;
      end
      		else
      begin
       Vys:='';
       for j:= 1 to A[i,2] do Vys[j]:='0';
       Vys:= BVys+Vys;
       BVys:= Vys;
       inc(i);
      end; 
    end;
  until (A[i,1]=9) and (A[i,2]=9)



end;



BEGIN
 Zn:= false;
 Nacitaj;
 writeln(slovo);
 Prevod;
 writeln(Vys);
END.