A,B=map(int,input().split()) l=list(range(A,B+1)) m=[23,24,25] print(len((set(l)^set(m))&set(m)))