var S = readLine()!
var T = readLine()!
let nums = S.count

var min = 0

for i in 0...nums - 1 {
    if S.first != T.first{
        min += 1
        S = String(S.dropFirst(1))
        T = String(T.dropFirst(1))
    } else {
        S = String(S.dropFirst(1))
        T = String(T.dropFirst(1))
        
    }
}

print(min)