process.stdin.resume();
process.stdin.setEncoding('utf8');
// 自分の得意な言語で
// Let's チャレンジ！！

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
 

var a = parseInt(lines[0].split(' ')[0],10);
var b = parseInt(lines[1].split(' ')[0],10);

if(a===b){
    console.log(0);
}else{
    console.log(1);
}

});