N = gets.to_i if N == 1 then puts -1 elsif N % 2 == 1 then puts 1 elsif N % 4 == 0 then puts 1 else puts -1 end