function main(arg) {
  const a = arg.split(/\r\n|\r|\n/).map(item => item.split(' ').map(Number))

  if (a[0][0] === a[1][0]) {
    console.log(0)
  } else {
    console.log(1)
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
