count :: String -> String -> String -> Int
count [] _ _ = 0
count (a:as) (b:bs) (c:cs) = if a == b && b == c then count as bs cs
  else if a /= b && b /= c && c /= a then 2+(count as bs cs)
  else 1+(count as bs cs)

main :: IO ()
main = do
  _ <- getLine
  a <- getLine
  b <- getLine
  c <- getLine
  putStrLn $ show $ count a b c