# -*- coding: utf-8 -*- a, b = map(int, input().split()) p = 3 date = [23, 24, 25] for i in range(a, b + 1): if (i in date) == True: p -= 1 print(p)