n = gets.to_i a = Math.sqrt(n).to_i result = false while true val = 0 b = 1 while a > b val = a**2 - b**2 result = true and break if val == n break if val < n b += 1 end break if result break if val > n a += 1 end puts result ? 1 : 0