a,b,c,d=map(int,input().split()) t=b+32-a if t>c: print(1) elif t>d: print(2) else: print(3)