function Main(input) {
	input = input.split("\n");
	line0 = input[0].split(" ");
	line1 = input[1].split(" ");
	var a = Number(line0[0]);
	var b = Number(line0[1]);
	var c = Number(line1[0]);
  	var d = Number(line1[1]);
	if(b > d){
      	console.log(1);
       }else{
       	console.log(0);
       }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));