l, r = list(map(int, input().split()))a = []for i in range(l, r+1): a.append(str(i))print(''.join(a).count('2'))