#include <bits/stdc++.h>
using namespace std;
long long mod = (1000000007LL);
inline long long mult(long long a, long long b) { return (a * b) % mod; }
inline long long poww(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int n, m, q, k, v[300050], ans[300050];
pair<int, int> w[300050];
string second;
deque<int> fila;
int qtd = 0;
string query(int x) {
  ++qtd;
  x++;
  cout << "? " << x << endl;
  string k;
  cin >> k;
  return k;
}
void reset() { cout << "R" << endl; }
int block[300050];
int32_t main() {
  cin >> n >> k;
  if (n == k) {
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (query(i) == "N") ans++;
    }
    cout << "! " << ans << endl;
    return 0;
  }
  if (k == 1) {
    int ans = 0;
    for (int i = 0; i < n; i++) {
      int can = 1;
      for (int j = 0; j < i; j++) {
        query(j);
        if (query(i) != "N") can = 0;
      }
      if (can) ans++;
    }
    cout << "! " << ans << endl;
    return 0;
  }
  vector<int> caras[2000];
  for (int i = 0; i < n; i++) {
    caras[2 * i / (k)].push_back(i);
  }
  for (int i = 0; i < n; i++) {
    if (caras[i].empty()) continue;
    reset();
    vector<int> good;
    for (auto x : caras[i]) {
      if (query(x) == "N") good.push_back(x);
    }
    caras[i] = good;
  }
  int ans = 0;
  for (int i = 0; i < 2000; i++) {
    if ((int)(caras[i]).size() == 0) continue;
    vector<int> can(n + 1);
    for (int j = 0; j <= n; j++) can[j] = 1;
    vector<int> good;
    for (int j = 0; j < i; j++) {
      reset();
      for (auto x : caras[j]) {
        query(x);
      }
      for (auto v : caras[i]) {
        if (query(v) == "Y") can[v] = 0;
      }
    }
    for (auto x : caras[i])
      if (can[x]) good.push_back(x);
    caras[i] = good;
    ans += (int)(good).size();
  }
  if (qtd > (2 * n * n) / k) cout << "TOO MUCH\n";
  cout << "! " << ans << endl;
}
