A,B = map(int,input().split()) contest_days = set(range(A,B+1)) trip_days = set([23,24,25]) ans =3 - len(trip_days & contest_days) print(ans)