#include <bits/stdc++.h>
using namespace std;
bitset<1024> f;
int main() {
  int n, k;
  cin >> n >> k;
  if (k == 1) k = 2;
  for (int i = 1; i < n / (k / 2); i++) {
    for (int j = 0; j < i; j++) {
      for (int l = j * (k / 2); l < n; l++) {
        cout << "? " << l + 1 << endl;
        string tmp;
        cin >> tmp;
        f[l] = f[l] | (tmp == "Y");
        if (l % (k / 2) == k / 2 - 1) {
          l += (k / 2) * (i - 1);
        }
      }
      cout << 'R' << endl;
    }
  }
  cout << "! " << n - f.count();
}
