#include <bits/stdc++.h>
using namespace std;
int __i__, __j__;
class _Debug {
 public:
  template <typename T>
  _Debug& operator,(T val) {
    cout << val << endl;
    return *this;
  }
};
int elim[1024];
int main() {
  int n, k;
  cin >> n >> k;
  int i, j, l;
  int b = max(k / 2, 1);
  for (i = 0; i < (n / b) / 2; i++) {
    for (j = 0; j < n / b; j++) {
      int u = i;
      if (j & 1)
        u -= (j + 1) / 2;
      else
        u += j / 2;
      u = (u + n / b) % (n / b);
      for (l = 0; l < b; l++) {
        int v = u * b + l;
        if (!elim[v]) {
          char c;
          cout << "? " << v + 1 << endl;
          cin >> c;
          if (c == 'Y') elim[v] = 1;
        }
      }
    }
    cout << "R" << endl;
  }
  int ans = 0;
  for (i = 0; i < n; i++) {
    if (!elim[i]) ans++;
  }
  cout << "! " << ans << endl;
  return 0;
}
