module Main where import Data.List (group) main :: IO () main = (>>) getLine $ print =<< solve <$> getList <*> getList solve :: [String] -> [String] -> Int solve a b = length . filter (not . head) . group $ zipWith (==) a b getList :: IO [String] getList = words <$> getLine