process.stdin.setEncoding('utf-8')
process.stdin.on('data', (data) => {
    const array = data.split(/[\n]/)
    let counter = 0
    let res = 0
    for (let character of array[0]){
        if (character !== array[1][0]){
            res ++
        }
        counter++
    }
    console.log(res)
})
