L=[5,8,7,8,2,6,4,6,8,9]
k=int(input("请输入 k 值:"))
j=0
for i in range(10):
if L[i]<=k:
L[j]=L[i]
j=j+1
print(L[2])