wc, hc, ws, hs = map(int, input().split()) print(0 if ws + 2 > wc or hs + 2 > hc else 1)