I=100
S=0
DO
K=I-INT(I/10)*10
M=INT(I/100)-INT(I/1000)*10
IF K=M THEN
S=S+1
END IF
I=I+1
LOOP UNTIL I>65374
PRINT S
END