#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
template <class T>
T gcd(T a, T b) {
  return !b ? a : gcd(b, a % b);
}
template <class T>
inline void umin(T &x, T y) {
  x = x < y ? x : y;
}
template <class T>
inline void umax(T &x, T y) {
  x = x > y ? x : y;
}
inline unsigned int R() {
  static unsigned int seed = 613;
  return seed ^= seed >> 5, seed ^= seed << 17, seed ^= seed >> 13;
}
const int N = 1 << 16 | 3;
int n, k, gg[N];
int yzr(int x) {
  printf("? %d\n", x);
  fflush(stdout);
  char S[66];
  scanf("%s", S);
  return S[0] == 'Y';
}
int main() {
  read(n);
  read(k);
  if (k == 1) {
    for (register int i = (1); i <= (n); i++)
      for (register int j = (i + 1); j <= (n); j++) {
        yzr(i);
        yzr(i);
        gg[j] |= yzr(j);
      }
    int res = 0;
    for (register int i = (1); i <= (n); i++) res += !gg[i];
    printf("! %d\n", res);
    fflush(stdout);
    return 0;
  }
  k /= 2;
  int cnt = n / k;
  for (register int d = (1); d <= (cnt - 1); d++)
    for (register int s = (1); s <= (d); s++)
      if (s + d <= cnt) {
        puts("R");
        fflush(stdout);
        for (int i = s; i <= cnt; i += d)
          for (register int j = ((i - 1) * k + 1); j <= ((i - 1) * k + k);
               j++) {
            gg[j] |= yzr(j);
          }
      }
  int res = 0;
  for (register int i = (1); i <= (n); i++) res += !gg[i];
  printf("! %d\n", res);
  fflush(stdout);
  return 0;
}
