trip_date=input() date=[int(i) for i in trip_date.split(" ")] vacation=range(date[0],date[1]+1) vacation_set=set(vacation) gassyuku_set={22,23,24} print(3-len(vacation_set & gassyuku_set))