#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
// https://codeforces.com/blog/entry/79148
class Timer: chrono::high_resolution_clock {
const time_point start_time;
public:
Timer(): start_time(now()) {}
rep elapsed_time() const {
return chrono::duration_cast<chrono::milliseconds>(now() - start_time).count();
}
} timer;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, ans = 1, cur = 1;
cin >> n;
for (int i = 2; i <= n; i++) {
while (true) {
int l = i - cur, r = i + cur, res;
if (l < 1 || r > n) {
break;
}
cout << "? " << l << " " << r << endl;
cin >> res;
if (res) {
ans = max(ans, 2 * cur + 1);
cur++;
}
else {
break;
}
}
}
cur = (ans + 1) / 2;
for (int i = cur; i <= n; i++) {
while (true) {
int l = i - cur + 1, r = i + cur, res;
if (l < 1 || r > n) {
break;
}
cout << "? " << l << " " << r << endl;
cin >> res;
if (res) {
ans = max(ans, 2 * cur);
cur++;
}
else {
break;
}
}
}
cout << "! " << ans << endl;
return 0;
}