#include <bits/stdc++.h>
using namespace std;
int n, k;
int uniq[1050];
bool query(int w) {
  cout << "? " << w + 1 << endl;
  char c;
  cin >> c;
  return (c == 'Y') ? false : true;
}
void solve(int left, int right) {
  int sz = right - left;
  if (sz == k) {
    for (int i = 0; i < k; i++)
      if (!query(left + i)) uniq[left + i] = 0;
    cout << "R" << endl;
  } else {
    int mid = (left + right) / 2;
    solve(left, mid);
    solve(mid, right);
    int ct = (right - left) / k;
    for (int i = 0; i < ct; i++) {
      for (int j = 0; j < ct; j++) {
        for (int w = 0; w < k / 2; w++) {
          query(left + i * k / 2 + w);
        }
        for (int w = 0; w < k / 2; w++) {
          if (!query(mid + j * k / 2 + w)) uniq[mid + j * k / 2 + w] = 0;
        }
      }
      cout << "R" << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  memset(uniq, -1, sizeof uniq);
  cin >> n >> k;
  if (n == 1) {
    cout << "! " << 1 << endl;
    exit(0);
  }
  if (k == 1) k++;
  solve(0, n);
  int res = 0;
  for (int i = 0; i < n; i++)
    if (uniq[i]) res++;
  cout << "! " << res << endl;
}
