#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); ++i) int Query(int x, int y) { printf("? %d %d\n", x, y); fflush(stdout); int z; cin >> z; return z; } int main() { int n; cin >> n; vector a(n, false); rep(i, n / 2) { if (a[i]) continue; int z = Query(2 * i, 2 * i + 1); if (z == 2 * i || z == 2 * i + 1) { printf("! %d\n", z ^ 1); fflush(stdout); return 0; } } printf("! %d\n", n - 1); fflush(stdout); return 0; }