Shakur and Tiham are playing a game. Initially, Shakur picks a positive integer not greater than $1000$. Then Tiham picks a positive integer strictly smaller than that.Then they keep on doing this taking turns to pick progressively smaller and smaller positive integers until some one picks $1$. After that, all the numbers that have been picked so far are added up. The person picking the number $1$ wins if and only if this sum is a perfect square. Otherwise, the other player wins. What is the sum of all possible values of $n$ such that if Shakur starts with the number $n$, he has a winning strategy?