import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

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

solve :: [String] -> Int
solve [xs, ys, zs] = sum . map count $ zip3 xs ys zs
    where
        count (a, b, c) = len - 1
            where
                len = length . group $ sort [a, b, c]

readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine