#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
template <class T, class S>
ostream &operator<<(ostream &o, const pair<T, S> &p) {
  return o << '(' << p.first << ", " << p.second << ')';
}
set<long long int> qs[2000];
set<long long int> ps[2000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int n;
  cin >> n;
  long long int k;
  cin >> k;
  for (long long int q = 0; q != n / k; q < n / k ? q++ : q--) {
    for (long long int i = q * k; i != (q + 1) * k;
         i < (q + 1) * k ? i++ : i--) {
      {
        cout << "? " << (i + 1) << endl;
        cout.flush();
      }
      string res;
      cin >> res;
      if (res == "N") qs[q].insert(i);
    }
    {
      cout << "R" << endl;
      cout.flush();
    }
  }
  for (long long int q = 0; q != n / k; q < n / k ? q++ : q--)
    while (qs[q].size() > ps[q].size()) {
      long long int x = *qs[q].begin();
      ps[q].insert(x);
      qs[q].erase(x);
    }
  for (long long int q1 = 0; q1 != n / k; q1 < n / k ? q1++ : q1--)
    for (long long int q2 = q1 + 1; q2 != n / k; q2 < n / k ? q2++ : q2--) {
      set<long long int> rems;
      for (long long int mask = 0; mask != 4; mask < 4 ? mask++ : mask--) {
        set<long long int> s1 = mask & 1 ? qs[q1] : ps[q1];
        set<long long int> s2 = mask & 2 ? qs[q2] : ps[q2];
        for (long long int i : s1) {
          {
            cout << "? " << (i + 1) << endl;
            cout.flush();
          }
          string res;
          cin >> res;
          if (res == "Y") rems.insert(i);
        }
        for (long long int i : s2) {
          {
            cout << "? " << (i + 1) << endl;
            cout.flush();
          }
          string res;
          cin >> res;
          if (res == "Y") rems.insert(i);
        }
        {
          cout << "R" << endl;
          cout.flush();
        }
      }
      for (long long int x : rems) {
        qs[q1].erase(x);
        qs[q2].erase(x);
        ps[q1].erase(x);
        ps[q2].erase(x);
      }
    }
  long long int ans = 0;
  for (long long int i = 0; i != n / k; i < n / k ? i++ : i--)
    ans += qs[i].size() + ps[i].size();
  {
    cout << "! " << ans << endl;
    cout.flush();
  }
}
