a=list(map(int,input().split())) b=int(input()) s=0 for x in range(10): if a[x]<=b: s+=1 else: if a[x]<=b+30: s+=1 else: s+=0 print(s)