solver::String->Int
solver str = let n = div (length str) 2 in
              2*((length.fst.last.(filter (\(x,y)->x==y))) [let (x,y)=(splitAt i str) in (x,(take i y))|i<-[1..(n-1)]])

main::IO()
main=do
  d<-getLine
  print (solver d)
