#include <bits/stdc++.h>
using namespace std;
const int N = 1025;
int impo[N], impo1[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cout << "? " << i << endl;
    fflush(stdout);
    char x;
    cin >> x;
    if (x == 'Y') impo[i] = 1;
    if (i % k == 0) cout << "R" << endl;
  }
  for (int i = 1; i < n / k; ++i) {
    for (int cnt = 0; cnt < i; ++cnt) {
      int j = 1 + k * cnt;
      while (j <= n) {
        for (int h = j; h < j + k; ++h) {
          if (impo[h]) continue;
          cout << "? " << h << endl;
          fflush(stdout);
          char x;
          cin >> x;
          if (x == 'Y') impo1[h] = 1;
        }
        j += k * i;
      }
      cout << "R" << endl;
      j = 1 + k * cnt;
      while (j <= n) {
        for (int h = j + k - 1; h >= j; --h) {
          if (impo[h]) continue;
          cout << "? " << h << endl;
          fflush(stdout);
          char x;
          cin >> x;
          if (x == 'Y') impo1[h] = 1;
        }
        j += k * i;
      }
      cout << "R" << endl;
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    if (impo1[i] == 0 && impo[i] == 0) ans++;
  cout << "! " << ans << endl;
}
