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