import re a = re.split("\s",input()) a0 = int(input()) t = 0 for b in a: if a0+30 >= int(b): t += 1 print(t)