菜鸡解法 # PYTHON
自守数
http://www.nowcoder.com/questionTerminal/88ddd31618f04514ae3a689e83f3ab8e
while True:
try:
limit = int(input())
res = 0
for i in range(limit):
size = len(str(i))
if str(i*i)[-size:] == str(i):
res += 1
print(res)
except:
break