https://www.luogu.com.cn/problem/P1046
"""
P1046 [NOIP2005 普及组] 陶陶摘苹果(python3实现)
https://www.luogu.com.cn/problem/P1046
"""
ans=0
a=list(map(int,input().split()))
b=int(input())
for i in range(10):
if a[i]<=b+30:
ans+=1
print(ans)