contest = {23,24,25} start,end = map(int,input().split()) travel = {x for x in range(start,end + 1)} intersect = len(travel & contest) join_count = len(contest) - intersect print(join_count)