solve [] [] = 0 solve (x:xs) (y:ys) | x /= y = 1 + solve xs ys | otherwise = solve xs ys main = do getLine s <- getLine t <- getLine print $ solve s t