import Control.Monad
import Data.List

main :: IO ()
main = getLine >> replicateM 3 getLine >>= print . solve

solve :: [String] -> Int
solve [as, bs, cs] = foldl' ff 0 $ zip3 as bs cs
    where
        ff acc (a, b, c) = acc + 3 - x
            where
                x = head . sortBy (flip compare) . map length . group $ sort [a, b, c]