function Main(input) { input = input.trim().split("\n"); const [a, b, c, d] = input[0].trim().split(" ").map(Number); let p = 31 - a + b; let res; if (p >= c) res = 1; else if (p >= d) res = 2; else res = 3; console.log(res); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));