#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int maxn = 1e4 + 10;
bool vis[maxn];
int num, sz, n, k;
vector<int> b[maxn];
void ask(int first) {
  char s[10];
  for (auto v : b[first]) {
    printf("? %d\n", v);
    fflush(stdout);
    scanf("%s", &s);
    if (s[0] == 'Y') vis[v] = 1;
  }
}
int main() {
  cin >> n >> k;
  sz = k / 2;
  if (!sz) sz = 1;
  num = (n + sz - 1) / sz;
  for (int i = 1; i <= n; ++i) {
    int bl = (i + sz - 1) / sz;
    b[bl].push_back(i);
  }
  for (int i = 1; i <= num; ++i)
    for (int j = i + 1; j <= num; ++j) {
      ask(i);
      ask(j);
      printf("R\n");
    }
  int cnt = 0;
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) ++cnt;
  printf("! %d\n", cnt);
  return 0;
}
