import Data.List

main :: IO ()
main = do
  a <- getLine
  print $ solve a

solve :: String -> Int
solve str | str == reverse str = 1
          | otherwise = length $ nub $ fmap (fil str) ls where
            l = length str - 1
            ls = [(a,b) | a <- [0..l] , b <- [1..l] , a < b]

fil :: String -> (Int,Int) -> String
fil str (a,b) = h ++ mid ++ tl where
  h = take a str
  tl = drop (b + 1) str
  mid = drop (length tl) $ reverse $ drop a str
