m@main=getLine>>=print.(0^).sum.foldl f[0].map fromEnum>>m f(a:b)c|(a-c)^2==4^5=b|0<1=c:a:b