A,B,C,D=map(int,input().split()) n=30+B-A+1 if n