#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vi = vector<int>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using ppii = pair<pi, int>;
using ppil = pair<pi, ll>;
using plpi = pair<ll, pi>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpil = vector<pil>;
using vpli = vector<pli>;
using vppii = vector<ppii>;
using si = set<int>;
using sl = set<ll>;
using spi = set<pi>;
using spli = set<pli>;
using vsi = vector<si>;
using qi = queue<int>;
using sti = stack<int>;
using tiii = tuple<int, int, int>;
using vtiii = vector<tiii>;
ll mx = (ll)1e12;
vector<bool> g;
bool rev = false;
int k, n;
char c;
int main() {
  cin >> n;
  cin >> k;
  g.resize(n);
  for (int i = 0; i != n; ++i) {
    g[i] = true;
  }
  for (int i = 0; i != k; ++i) {
    cout << "? " << i + 1 << endl;
    cin >> c;
    if (c == 'Y') {
      g[i] = false;
    }
  }
  for (int i = k; i != n; i += k) {
    for (int j = i + k - 1; j != i - 1; --j) {
      cout << "? " << j + 1 << endl;
      cin >> c;
      if (c == 'Y') {
        g[j] = false;
      }
    }
    for (int j = i - 1; j != i - k - 1; --j) {
      cout << "? " << j + 1 << endl;
      cin >> c;
    }
    for (int j = i; j != i + k; ++j) {
      if (!g[j]) {
        continue;
      }
      cout << "? " << j + 1 << endl;
      cin >> c;
      if (c == 'Y') {
        g[j] = false;
      }
    }
    for (int f = i - k - 1; f != -1; f -= k) {
      for (int l = f; l != f - k; --l) {
        cout << "? " << l + 1 << endl;
        cin >> c;
      }
      for (int j = i + k - 1; j != i - 1; --j) {
        if (!g[j]) {
          continue;
        }
        cout << "? " << j + 1 << endl;
        cin >> c;
        if (c == 'Y') {
          g[j] = false;
        }
      }
      for (int l = f - k + 1; l != f + 1; ++l) {
        cout << "? " << l + 1 << endl;
        cin >> c;
      }
      for (int j = i; j != i + k; ++j) {
        if (!g[j]) {
          continue;
        }
        cout << "? " << j + 1 << endl;
        cin >> c;
        if (c == 'Y') {
          g[j] = false;
        }
      }
    }
  }
  int ans = 0;
  for (auto x : g) {
    if (x) {
      ans++;
    }
  }
  cout << "! " << ans << endl;
}
