VAR ST:STRING;
    I,D,d1,d2:INTEGER;
BEGIN
     WRITE('NHAP XAU: '); READLN(ST); WRITELN;
     WHILE ST[1]=' ' DO DELETE(ST,1,1);
     WHILE ST[LENGTH(ST)]=' ' DO DELETE(ST,LENGTH(ST),1);
     WHILE POS('  ',ST)<>0 DO DELETE(ST,POS('  ',ST),1);
     WRITE('XAU CHUAN HOA: ',ST);WRITELN;
     D:=0; D1:=0; D2:=0;
     FOR I:=1 TO LENGTH(ST) DO
     BEGIN
          IF ST[I]IN['a'..'z'] then D:=D+1;
          IF ST[I]IN['A'..'Z'] then D1:=D1+1;
          IF ST[I]IN['0'..'9'] then D2:=D2+1;
     end;
     WRITE('SO LUONG KY TU IN THUONG: ',D) ;WRITELN;
     WRITE('SO LUONG KY TU IN HOA   : ',D1);WRITELN;
     WRITE('SO LUONG KY TU CHU SO   : ',D2);WRITELN;
READLN
END.