#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 0;
  char ch = getchar();
  while (!isdigit(ch)) f = ch == '-', ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return f ? -x : x;
}
const int N = 1024 + 5;
int n, k;
int Ask(int c) {
  if (c == -1) return 0;
  printf("? %d\n", c + 1);
  fflush(stdout);
  string s;
  cin >> s;
  return s == "Y";
}
void R() {
  printf("R\n");
  fflush(stdout);
}
void Answer(int x) {
  printf("! %d\n", x);
  fflush(stdout);
  exit(0);
}
int a[N], las, b, c;
void Ins_block(int c) {
  int cnt = 0;
  for (int i = (c * b); i <= ((c + 1) * b - 1); i++)
    if (!a[i]) {
      a[i] |= Ask(i);
      las = i;
    } else
      ++cnt;
  while (cnt--) Ask(las);
}
int main() {
  n = read(), k = read();
  b = max(k / 2, 1), c = n / b;
  for (int s = (0); s <= (c - 1); s++) {
    if (c > 1 && c / 2 - (s >= c / 2) <= 0) continue;
    int t = s;
    las = -1;
    Ins_block(t);
    for (int i = (1); i <= (c / 2 - (s >= c / 2)); i++) {
      if (i & 1)
        t = (t + i) % c;
      else
        t = (t - i + c) % c;
      Ins_block(t);
    }
    R();
  }
  int ans = 0;
  for (int i = (0); i <= (n - 1); i++)
    if (!a[i]) ans++;
  Answer(ans);
  return 0;
}
