module Main (main) where

import Control.Monad
import qualified Data.ByteString.Char8 as C8
import Data.Bool
import Data.List

main :: IO ()
main = replicateM 2 readStrings >>= print . solve

solve [[xs], [ys]] = foldl' f 0 $ zipWith (==) xs ys
  where
    f acc = (acc +) . bool 0 1

readStrings :: IO [String]
readStrings = map C8.unpack . C8.words <$> C8.getLine