f s t = f' s t 0
    where
        f' [] _ n = n
        f' s@(sx:sxs) t@(tx:txs) n
            = f' sxs txs $ if sx /= tx then n + 1 else n

main = do
    s <- getLine
    t <- getLine
    print $ f s t
