def test(n):
ans=0
for i in range(20,n):
a = i
while True:
if a%3!=0 and a>0:
a-=20
if a == 3:
testing = True
break
elif a<0:
testing=True
break
else:
testing=False
break
if testing:
ans=i
testing=True
return ans