#include <bits/stdc++.h>
bool v[1024];
char c[2];
int n, k;
int main() {
  scanf("%d%d", &n, &k);
  if (k > 1) k >>= 1;
  for (int i = 0; i < n; i += k) {
    for (int j = i + k; j < n; j += k) {
      for (int a = 0; a < k; a++) {
        printf("? %d\n", a + i + 1);
        fflush(stdout);
        scanf("%1s", c);
        v[a + i] |= c[0] == 'Y';
      }
      for (int a = 0; a < k; a++) {
        printf("? %d\n", a + j + 1);
        fflush(stdout);
        scanf("%1s", c);
        v[a + j] |= c[0] == 'Y';
      }
      puts("R");
      fflush(stdout);
    }
  }
  for (int i = k = 0; i < n; i++) k += !v[i];
  printf("! %d\n", k);
  return 0;
}
