s,e=map(int,input().split()) d=3 for i in range(s,e+1): if i==23: d-=1 elif i==24: d-=1 elif i==25: d-=1 print(d)