function Main(input) {
  lines = input.split("\n");
  m1 = lines[0].split(" ")[0];
  m2 = lines[1].split(" ")[0];

  if (m1 === m2) {
    console.log(0);
  } else {
    console.log(1);
  }

  }
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
