#include <bits/stdc++.h>
using namespace std;

// template {{{
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize

#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; })

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;

using vpii = vector<pii>;
using vvpii = vector<vpii>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
using vpdd = vector<pdd>;
using vvpdd = vector<vpdd>;

template<typename T> void ckmin(T& a, const T& b) { a = min(a, b); }
template<typename T> void ckmax(T& a, const T& b) { a = max(a, b); }

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

namespace __input {
    template<class T1, class T2> void re(pair<T1,T2>& p);
    template<class T> void re(vector<T>& a);
    template<class T, size_t SZ> void re(array<T,SZ>& a);

    template<class T> void re(T& x) { cin >> x; }
    void re(double& x) { string t; re(t); x = stod(t); }
    template<class Arg, class... Args> void re(Arg& first, Args&... rest) {
        re(first); re(rest...);
    }

    template<class T1, class T2> void re(pair<T1,T2>& p) { re(p.f,p.s); }
    template<class T> void re(vector<T>& a) { F0R(i,sz(a)) re(a[i]); }
    template<class T, size_t SZ> void re(array<T,SZ>& a) { F0R(i,SZ) re(a[i]); }
}
using namespace __input;

namespace __output {
    template<class T1, class T2> void pr(const pair<T1,T2>& x);
    template<class T, size_t SZ> void pr(const array<T,SZ>& x);
    template<class T> void pr(const vector<T>& x);
    template<class T> void pr(const deque<T>& x);
    template<class T> void pr(const set<T>& x);
    template<class T1, class T2> void pr(const map<T1,T2>& x);

    template<class T> void pr(const T& x) { cout << x; }
    template<class Arg, class... Args> void pr(const Arg& first, const Args&... rest) {
        pr(first); pr(rest...);
    }

    template<class T1, class T2> void pr(const pair<T1,T2>& x) {
        pr("{",x.f,", ",x.s,"}");
    }
    template<class T, bool pretty = true> void prContain(const T& x) {
        if (pretty) pr("{");
        bool fst = 1; for (const auto& a: x) pr(!fst?pretty?", ":" ":"",a), fst = 0;
        if (pretty) pr("}");
    }
    template<class T> void pc(const T& x) { prContain<T, false>(x); pr("\n"); }
    template<class T, size_t SZ> void pr(const array<T,SZ>& x) { prContain(x); }
    template<class T> void pr(const vector<T>& x) { prContain(x); }
    template<class T> void pr(const deque<T>& x) { prContain(x); }
    template<class T> void pr(const set<T>& x) { prContain(x); }
    template<class T1, class T2> void pr(const map<T1,T2>& x) { prContain(x); }

    void ps() { pr("\n"); }
    template<class Arg> void ps(const Arg& first) {
        pr(first); ps();
    }
    template<class Arg, class... Args> void ps(const Arg& first, const Args&... rest) {
        pr(first," "); ps(rest...);
    }
}
using namespace __output;

#define TRACE(x) x
#define __pn(x) pr(#x, " = ")
#define pd(...) __pn((__VA_ARGS__)), ps(__VA_ARGS__), cout << flush

namespace __algorithm {
    template<typename T> void dedup(vector<T>& v) {
        sort(all(v)); v.erase(unique(all(v)), v.end());
    }
    template<typename T> typename vector<T>::iterator find(vector<T>& v, const T& x) {
        auto it = lower_bound(all(v), x); return it != v.end() && *it == x ? it : v.end();
    }
    template<typename T> size_t index(vector<T>& v, const T& x) {
        auto it = find(v, x); assert(it != v.end() && *it == x); return it - v.begin();
    }
    template<typename C, typename T, typename OP> vector<T> prefixes(const C& v, T id, OP op) {
        vector<T> r(sz(v)+1, id); F0R (i, sz(v)) r[i+1] = op(r[i], v[i]); return r;
    }
    template<typename C, typename T, typename OP> vector<T> suffixes(const C& v, T id, OP op) {
        vector<T> r(sz(v)+1, id); F0Rd (i, sz(v)) r[i] = op(v[i], r[i+1]); return r;
    }
}
using namespace __algorithm;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
struct monostate {
    friend istream& operator>>(istream& is, const monostate& ms) { return is; }
    friend ostream& operator<<(ostream& os, const monostate& ms) { return os; }
    friend monostate operator+(const monostate& a, const monostate& b) { return a; }
} ms;
#pragma GCC diagnostic pop

namespace __io {
    void setIn(string s) { freopen(s.c_str(),"r",stdin); }
    void setOut(string s) { freopen(s.c_str(),"w",stdout); }
    void setIO(string s = "") {
        ios_base::sync_with_stdio(0); cin.tie(0);
        cout << fixed << setprecision(15);
        if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
    }
}
using namespace __io;
// }}}

bool taste(int loc) {
    ps("?", loc + 1);
    cout << flush;
    char r; re(r);
    if (r == 'E') assert(0);
    return r == 'Y';
}

void clear() {
    ps("R");
    cout << flush;
}

void finish(vi ans) {
    ps("!", sz(ans));
    cout << flush;
}

vi solve(int L, int R, int K) {
    if (R - L == K) {
        vi res;
        clear();
        FOR (loc, L, R) if (taste(loc)) res.pb(loc);
        return res;
    }
    assert(R - L > K);

    vi left  = solve(L, (L + R) / 2, K),
       right = solve((L + R) / 2, R, K);

    vi res = left;

    for (int i = 0; i < sz(right); i += K/2) {
        vb should(K / 2, 1);

        for (int j = 0; j < sz(left); j += K/2) {
            clear();
            FOR (k, j, min(sz(left), j + K/2)) {
                taste(left[k]);
            }
            FOR (k, i, min(sz(right), i + K/2)) {
                should[k] = should[k] & taste(right[k]);
            }
        }

        FOR (k, i, min(sz(right), i + K/2))
            if (should[k])
                res.pb(right[k]);
    }

    return res;
}

int main() {
    setIO();

    int N, K; re(N, K);

    if (K == 1) { // n^2 <= 10,000
        vi ans = {0};
        FOR (loc, 1, N) {
            bool add = 1;
            trav (e, ans) {
                clear();
                taste(e);
                add &= taste(loc);
            }
            if (add) ans.pb(loc);
        }
        finish(ans);
    } else {
        finish(solve(0, N, K));
    }

    // did you check N=1? did you mix up N,M?
    // check your "infinity" and "null" values against the bounds
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

typedef long long ll;
typedef pair<int, int> pii;

int main()
{
    int n, k;
    scanf("%d %d", &n, &k);
    if (k == 1) k = 2;
    k /= 2;
    n /= k;

    function<bool(int)> ask = [&](int i) {
        printf("? %d\n", i + 1);
        fflush(stdout);
        char res;
        scanf(" %c", &res);
        return res == 'Y';
    };
    function<void()> clear = [&]() {
        printf("R\n");
        fflush(stdout);
    };

    vector<int> diff(n, true);
    function<void(int)> ask_block = [&](int i) {
        for (int c = i * k; c < (i + 1) * k; ++c) {
            if (ask(c)) diff[c] = false;
        }
    };

    for (int d = 1; d < n; ++d) {
        for (int r = 0; r < d; ++r) {
            if (r + d >= n)
                break;
            for (int i = r; i < n; i += d)
                ask_block(i);
            clear();
        }
    }

    int uniq = 0;
    for (int i = 0; i < n * k; ++i)
        uniq += (int)diff[i];
    printf("! %d\n", uniq);
    fflush(stdout);

}


#include <bits/stdc++.h>

using namespace std;

#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

typedef long long ll;
typedef pair<int, int> pii;

int main()
{
    int n, k;
    scanf("%d %d", &n, &k);
    if (k == 1) k = 2;
    k /= 2;
    n /= k;

    function<bool(int)> ask = [&](int i) {
        printf("? %d\n", i + 1);
        fflush(stdout);
        char res;
        scanf(" %c", &res);
        return res == 'Y';
    };
    function<void()> clear = [&]() {
        printf("R\n");
        fflush(stdout);
    };

    vector<int> diff(n * k, true);
    function<void(int)> ask_block = [&](int i) {
        for (int c = i * k; c < (i + 1) * k; ++c) {
            if (ask(c)) diff[c] = false;
        }
    };

    for (int d = 1; d < n; ++d) {
        for (int r = 0; r < d; ++r) {
            if (r + d >= n)
                break;
            for (int i = r; i < n; i += d)
                ask_block(i);
            clear();
        }
    }

    int uniq = 0;
    for (int i = 0; i < n * k; ++i)
        uniq += (int)diff[i];
    printf("! %d\n", uniq);
    fflush(stdout);

}


#include <functional>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <deque>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <sstream>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <iostream>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;

typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef pair<db,db> pd;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<str> vs;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<pd> vpd;

typedef set<int> si;
typedef set<ll> sl;
typedef set<db> sd;
typedef set<str> ss;
typedef set<pi> spi;
typedef set<pl> spl;
typedef set<pd> spd;

#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound

#define forr(i,a,b) for (int i = (a); i < (b); i++)
#define ford(i,a,b) for (int i = (a)-1; i >= (b); i--)
#define trav(a,x) for (auto& a: x)

const ll MOD = 1e9+7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
bool sortcol(const vl& v1, const vl& v2) {return v1[1] < v2[1];}

template<class T> bool ckmin(T& a, const T& b) {
	return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) {
	return a < b ? a = b, 1 : 0; }
int pct(int x) { return __builtin_popcount(x); }
int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))
int cdiv(int a, int b) { return a/b+!(a<0||a%b == 0); } // division of a by b rounded up, assumes b > 0
int fstTrue(function<bool(int)> f, int lo, int hi) {
	hi ++; assert(lo <= hi); // assuming f is increasing
	while (lo < hi) { // find first index such that f is true
		int mid = (lo+hi)/2;
		f(mid) ? hi = mid : lo = mid+1;
	}
	return lo;
}

mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))

// ifstream cin("");
// ofstream cout("");

const int mxN = 2e5;
int q = 1, n, k, idx, ans;
bool pos, vis[2000];
str s;

void solve() {
	cin >> n >> k;
	forr(i,0,n/k) {
		pos = 1;
		cout << "R\n";
		cout.flush();
		forr(j,0,n/k) {
			if (pos) idx += j; else idx -= j;
			pos = !pos;
			idx = (idx+n/k)%(n/k);
			forr(p,k*idx,k*(idx+1)) {
				if (!vis[p]) {
					cout << "? " << p+1 << "\n";
					cout.flush();
					cin >> s;
					if (s == "Y") vis[p] = 1;
				}
			}
		}
	}
	forr(i,0,n) ans += !vis[i];
	cout << ans << "\n";
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	// cin >> q;
	while(q--) {
		solve();
	}
}


#include <functional>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <deque>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <sstream>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <iostream>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;

typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef pair<db,db> pd;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<str> vs;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<pd> vpd;

typedef set<int> si;
typedef set<ll> sl;
typedef set<db> sd;
typedef set<str> ss;
typedef set<pi> spi;
typedef set<pl> spl;
typedef set<pd> spd;

#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound

#define forr(i,a,b) for (int i = (a); i < (b); i++)
#define ford(i,a,b) for (int i = (a)-1; i >= (b); i--)
#define trav(a,x) for (auto& a: x)

const ll MOD = 1e9+7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
bool sortcol(const vl& v1, const vl& v2) {return v1[1] < v2[1];}

template<class T> bool ckmin(T& a, const T& b) {
	return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) {
	return a < b ? a = b, 1 : 0; }
int pct(int x) { return __builtin_popcount(x); }
int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))
int cdiv(int a, int b) { return a/b+!(a<0||a%b == 0); } // division of a by b rounded up, assumes b > 0
int fstTrue(function<bool(int)> f, int lo, int hi) {
	hi ++; assert(lo <= hi); // assuming f is increasing
	while (lo < hi) { // find first index such that f is true
		int mid = (lo+hi)/2;
		f(mid) ? hi = mid : lo = mid+1;
	}
	return lo;
}

mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))

// ifstream cin("");
// ofstream cout("");

const int mxN = 2e5;
int q = 1, n, k, idx, ans;
bool pos, vis[2000];
str s;

void solve() {
	cin >> n >> k;
	forr(i,0,n/k) {
	    idx = i;
		pos = 1;
		cout << "R\n";
		cout.flush();
		forr(j,0,n/k) {
			if (pos) idx += j; else idx -= j;
			pos = !pos;
			idx = (idx+n/k)%(n/k);
			forr(p,k*idx,k*(idx+1)) {
				if (!vis[p]) {
					cout << "? " << p+1 << "\n";
					cout.flush();
					cin >> s;
					if (s == "Y") vis[p] = 1;
				}
			}
		}
	}
	forr(i,0,n) ans += !vis[i];
	cout << "! " << ans << "\n";
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	// cin >> q;
	while(q--) {
		solve();
	}
}


#include <functional>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <deque>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <sstream>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <iostream>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;

typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef pair<db,db> pd;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<str> vs;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<pd> vpd;

typedef set<int> si;
typedef set<ll> sl;
typedef set<db> sd;
typedef set<str> ss;
typedef set<pi> spi;
typedef set<pl> spl;
typedef set<pd> spd;

#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound

#define forr(i,a,b) for (int i = (a); i < (b); i++)
#define ford(i,a,b) for (int i = (a)-1; i >= (b); i--)
#define trav(a,x) for (auto& a: x)

const ll MOD = 1e9+7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
bool sortcol(const vl& v1, const vl& v2) {return v1[1] < v2[1];}

template<class T> bool ckmin(T& a, const T& b) {
	return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) {
	return a < b ? a = b, 1 : 0; }
int pct(int x) { return __builtin_popcount(x); }
int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))
int cdiv(int a, int b) { return a/b+!(a<0||a%b == 0); } // division of a by b rounded up, assumes b > 0
int fstTrue(function<bool(int)> f, int lo, int hi) {
	hi ++; assert(lo <= hi); // assuming f is increasing
	while (lo < hi) { // find first index such that f is true
		int mid = (lo+hi)/2;
		f(mid) ? hi = mid : lo = mid+1;
	}
	return lo;
}

mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))

// ifstream cin("");
// ofstream cout("");

const int mxN = 2e5;
int q = 1, n, k, idx, ans;
bool pos, vis[2000];
str s;

void solve() {
	cin >> n >> k;
	forr(i,0,n/k) {
		pos = 1;
		cout << "R\n";
		cout.flush();
		forr(j,0,n/k) {
			if (pos) idx += j; else idx -= j;
			pos = !pos;
			idx = (idx+n/k)%(n/k);
			forr(p,k*idx,k*(idx+1)) {
				if (!vis[p]) {
					cout << "? " << p+1 << "\n";
					cout.flush();
					cin >> s;
					if (s == "Y") vis[p] = 1;
				}
			}
		}
	}
	forr(i,0,n) ans += !vis[i];
	cout << "! " << ans << "\n";
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	// cin >> q;
	while(q--) {
		solve();
	}
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=1007;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
//#define int ll

#ifdef HNO2
#define IOS
#else
//#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int n,k,N;
int kill[maxn];

bool ask(int p)
{
    cout<<"? "<<p+1<<endl;
    char x; cin>>x;
    if (x=='E') exit(0);
    return (x=='Y');
}

int32_t main()
{
    IOS
    cin>>n>>k;
    N=n/k;

    for (int i=0;i<N;i++)
    {
        int d=0;
        cout<<'R'<<endl;
        for (int _=0;_<N;_++)
        {
            int cur=(i+d+N)%N;
            for (int j=cur*k;j<min(cur*k+k,N);j++)
                if (!kill[j]&&ask(j)) kill[j]=1;
            if (d>=0) d++;
            d=-d;
        }
    }

    int ans=0;
    for (int i=0;i<n;i++) ans+=(kill[i]==0);
    cout<<"! "<<ans<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=1007;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
//#define int ll

#ifdef HNO2
#define IOS
#else
//#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int n,k,N;
int kill[maxn];

bool ask(int p)
{
    cout<<"? "<<p+1<<endl;
    char x; cin>>x;
    if (x=='E') exit(0);
    return (x=='Y');
}

int32_t main()
{
    IOS
    cin>>n>>k;

    int B=(k==1 ? 1 : k/2);
    N=(n-1)/B+1;

    for (int i=0;i<N;i++)
    {
        int d=0;
        cout<<'R'<<endl;
        for (int _=0;_<N;_++)
        {
            int cur=(i+d+N)%N;
            for (int j=cur*B;j<min(cur*B+B,n);j++)
                if (!kill[j]&&ask(j)) kill[j]=1;
            if (d>=0) d++;
            d=-d;
        }
    }

    int ans=0;
    for (int i=0;i<n;i++) ans+=(kill[i]==0);
    cout<<"! "<<ans<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=1097;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
//#define int ll

#ifdef HNO2
#define IOS
#else
//#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int n,k,N;
int kill[maxn];

bool ask(int p)
{
    cout<<"? "<<p+1<<endl;
    char x; cin>>x;
    if (x=='E') exit(0);
    return (x=='Y');
}

int32_t main()
{
    IOS
    cin>>n>>k;

    int B=(k==1 ? k : k);
    N=(n-1)/B+1;

    for (int i=0;i<N;i++)
    {
        int d=0;
        cout<<'R'<<endl;
        for (int _=0;_<N;_++)
        {
            int cur=(i+d+N)%N;
            for (int j=cur*B;j<min(cur*B+B,n);j++)
                if (!kill[j]&&ask(j)) kill[j]=1;
            if (d>=0) d++;
            d=-d;
        }
    }

    int ans=0;
    for (int i=0;i<n;i++) ans+=(kill[i]==0);
    cout<<"! "<<ans<<endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=1007;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
//#define int ll

#ifdef HNO2
#define IOS
#else
//#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int n,k,N;
int kill[maxn];

bool ask(int p)
{
    cout<<"? "<<p+1<<endl;
    char x; cin>>x;
    if (x=='E') exit(0);
    return (x=='Y');
}

int32_t main()
{
    IOS
    cin>>n>>k;

    int B=(k==1 ? k : k);
    N=(n-1)/B+1;

    for (int i=0;i<N;i++)
    {
        int d=0;
        cout<<'R'<<endl;
        for (int _=0;_<N;_++)
        {
            int cur=(i+d+N)%N;
            for (int j=cur*B;j<min(cur*B+B,n);j++)
                if (!kill[j]&&ask(j)) kill[j]=1;
            if (d>=0) d++;
            d=-d;
        }
    }

    int ans=0;
    for (int i=0;i<n;i++) ans+=(kill[i]==0);
    cout<<"! "<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 30006;
int n,k;
int good[maxn];
void reset(){
    cout<<"R"<<endl;
}
bool query(int x){
    cout<<"? "<<x+1<<endl;
    string s;cin>>s;
    if(s[0]=='Y')return true;
    return false;
}
int main(){
    cin>>n>>k;
    for(int i=0;i<n;i++)
        good[i]=1;
    if(k==1){
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                reset();
                query(i);
                if(query(j)){
                    good[j]=false;
                }
            }
        }
    }else{
        int block=k/2;
        int m=n/block;
        for(int jump=1;jump<m;jump++){
            for(int start=0;start<jump&&start+jump<m;start++){
                reset();
                for(int i=start;i<m;i+=jump){
                    for(int x=i*block;x<(i+1)*block;x++){
                        if(query(x)){
                            good[x]=false;
                        }
                    }
                }
            }
        }
    }
    int ans = 0;
    for(int i=0;i<n;i++){
        if(good[i])ans++;
    }
    cout<<"! "<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 30006;
int n,k;
int good[maxn];
void reset(){
    cout<<"R"<<endl;
}
bool query(int x){
    cout<<"? "<<x+1<<endl;
    string s;cin>>s;
    if(s[0]=='Y')return true;
    return false;
}
int main(){
    cin>>n>>k;
    for(int i=0;i<n;i++)
        good[i]=1;
    if(k==1){
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                reset();
                query(i);
                if(query(j)){
                    good[j]=false;
                }
            }
        }
    }else{
        int block=k/2;
        int m=n/block;
        for(int jump=1;jump<m;jump++){
            for(int start=0;start<jump&&start+jump<m;start++){
                reset();
                for(int i=start;i<m;i+=jump){
                    for(int x=i*block;x<(i+1)*block;x++){
                        if(query(x)){
                            good[x]=false;
                        }
                    }
                }
            }
        }
    }
    int ans = 0;
    for(int i=0;i<n;i++){
        if(good[i])ans++;
    }
    cout<<ans<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M1 1000000007
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b) for(ll i=b-1;i>=a;i--)
#define F first
#define S second
#define PB push_back
#define DB pop_back
#define MP make_pair
#define MT make_tuple
#define G(a,b) get<a>(b)
#define V(a) vector<a>

template<typename T>
#define o_set(T) tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

ll modI(ll a,ll m);
ll gcd(ll a,ll b);
ll powM(ll x,ll y,ll m);
template<typename T>
void pairsort(T a[],T b[],ll n);
ll logint(ll x,ll y);
void Miden(ll **p1,ll n);
void Mmult(ll **p1,ll **p2,ll **ans,ll x,ll y,ll z,ll m);
void Mpow(ll **p1,ll **ans,ll n,ll y,ll m);
pll Egcd(ll x,ll y);
ll PrimRoot(ll n,ll x);
void fft(ll a[],ll n,bool invert,ll m,ll x);
V(ll) PolyMult(V(ll) &a,V(ll) &b,ll m,ll x);

ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}

pll Egcd(ll x,ll y)
{
    if(x==0) return MP(0,1);
    pll t=Egcd(y%x,x);
    return MP(t.S-t.F*(y/x),t.F);
}

ll powM(ll x,ll y,ll m)
{
    if(y==0) return 1;
    ll p=powM(x,y/2,m)%m;
    p=(p*p)%m;
    return (y%2==0)?p:(x*p)%m;
}

ll modI(ll a, ll m)
{
    ll m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        ll q=a/m;
        ll t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}

template<typename T>
void pairsort(T a[],T b[],ll n)
{
    pair<T,T> v[n];
    REP(i,0,n)
    {
        v[i].F=a[i];
        v[i].S=b[i];
    }
    sort(v,v+n);
    REP(i,0,n)
    {
        a[i]=v[i].F;
        b[i]=v[i].S;
    }
}

ll logint(ll x,ll y)
{
    ll ans=0;
    ll a=1;
    for(ll i=0;i<=x;i++)
    {
        if(x<a)
        {
            return ans;
        }
        ans++;
        a*=y;
    }
    return -1;
}

void Miden(ll **p1,ll n)
{
    ll (*x)[n]=(ll(*)[n]) p1;
    REP(i,0,n)
    {
        REP(j,0,n)
        {
            x[i][j]=0;
        }
        x[i][i]=1;
    }
    return;
}

void Mmult(ll **p1,ll **p2,ll **ans,ll x,ll y,ll z,ll m)
{
    ll (*a)[y]=(ll (*)[y])p1;
    ll (*b)[z]=(ll (*)[z])p2;
    ll (*c)[z]=(ll (*)[z])ans;
    REP(i,0,x)
    {
        REP(j,0,z)
        {
            c[i][j]=0;
            REP(k,0,y)
            {
                c[i][j]+=a[i][k]*b[k][j];
                c[i][j]%=m;
            }
        }
    }
    return;
}

void Mpow(ll **p1,ll **ans,ll n,ll y,ll m)
{
    if(y==0)
    {
        Miden(ans,n);
        return;
    }
    ll t[n][n];
    Mpow(p1,(ll **)t,n,y/2,m);
    ll z[n][n];
    Mmult((ll **)t,(ll **)t,(ll **)z,n,n,n,m);
    if(y%2)
    {
        Mmult((ll **)z,p1,ans,n,n,n,m);
    }
    else
    {
        Miden((ll **)t,n);
        Mmult((ll **)z,(ll **)t,ans,n,n,n,m);
    }
    return;
}

ll PrimRoot(ll p,ll x)
{
    //finds primitive root of prime p greater than x(If it doesnt exist, returns 0)
    V(ll) v;
    ll t=p-1;
    REP(i,2,t+1)
    {
        if(i*i>t) break;
        if(t%i==0)
        {
            v.PB((p-1)/i);
            while(t%i==0)
            {
                t/=i;
            }
        }
    }
    if(t>1) v.PB((p-1)/t);
    REP(i,x+1,p)
    {
        ll flag=0;
        REP(j,0,v.size())
        {
            if(powM(i,v[j],p)==1)
            {
                flag=1;
                break;
            }
        }
        if(flag==0)
        {
            return i;
        }
    }

    return 0;
}

void fft(ll a[],ll n,bool invert,ll m,ll x)
{
    if(n==1) return;
    ll d[2][n>>1];
    REP(i,0,n/2)
    {
        d[0][i]=a[i<<1];
        d[1][i]=a[(i<<1)+1];
    }
    fft(d[0],n>>1,invert,m,(x*x)%m);
    fft(d[1],n>>1,invert,m,(x*x)%m);
    ll r=1;
    if(invert) x=modI(x,m);
    REP(i,0,n>>1)
    {
        a[i]=(d[0][i]+(r*d[1][i])%m)%m;
        if(a[i]<0) a[i]+=m;
        a[i+(n>>1)]=(d[0][i]-(r*d[1][i])%m)%m;
        if(a[i+(n>>1)]<0) a[i+(n>>1)]+=m;
        r*=x;
        r%=m;
    }
    if(invert)
    {
        ll inv2=modI(2,m);
        REP(i,0,n)
        {
            a[i]=(a[i]*inv2)%m;
        }
    }
    return;
}

V(ll) PolyMult(V(ll) &a,V(ll) &b,ll m,ll x)
{
    ll n=1;
    while(n<a.size()+b.size())
    {
        n<<=1;
    }
    ll fa[n]={};
    ll fb[n]={};
    ll f[n]={};
    REP(i,0,a.size())
    {
        fa[i]=a[i];
    }
    REP(i,0,b.size())
    {
        fb[i]=b[i];
    }
    ll y=powM(x,(m-1)/n,m);
    fft(fa,n,false,m,y);
    fft(fb,n,false,m,y);
    REP(i,0,n)
    {
        f[i]=(fa[i]*fb[i])%m;
    }
    fft(f,n,true,m,y);
    V(ll) v(n);
    REP(i,0,n)
    {
        v[i]=f[i];
    }
    return v;
}

static ll n,k;
static char c;
static set<ll> st;

int main()
{
    cin>>n>>k;
    if(n==1)
    {
        cout<<"! 1"<<endl;
        return 0;
    }
    REP(i,1,n+1) st.insert(i);
    ll t=n/k;
    if(t==1)
    {
        REP(l,1,k+1)
        {
            cout<<'?'<<' '<<l<<endl;
            cin>>c;
            if(c=='Y'&&st.count(l)) st.erase(st.find(l));
        }
    }
    REP(i,0,t)
    {
        REP(j,i+1,t)
        {
            REP(l,1,k+1)
            {
                cout<<'?'<<' '<<i*k+l<<endl;
                cin>>c;
                if(c=='Y'&&st.count(i*k+l)) st.erase(st.find(i*k+l));
            }
            REP(l,1,k+1)
            {
                cout<<'?'<<' '<<j*k+l<<endl;
                cin>>c;
                if(c=='Y'&&st.count(j*k+l)) st.erase(st.find(j*k+l));
            }
            cout<<'R'<<endl;
        }
    }
    cout<<'!'<<' '<<st.size()<<endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M1 1000000007
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b) for(ll i=b-1;i>=a;i--)
#define F first
#define S second
#define PB push_back
#define DB pop_back
#define MP make_pair
#define MT make_tuple
#define G(a,b) get<a>(b)
#define V(a) vector<a>

template<typename T>
#define o_set(T) tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

ll modI(ll a,ll m);
ll gcd(ll a,ll b);
ll powM(ll x,ll y,ll m);
template<typename T>
void pairsort(T a[],T b[],ll n);
ll logint(ll x,ll y);
void Miden(ll **p1,ll n);
void Mmult(ll **p1,ll **p2,ll **ans,ll x,ll y,ll z,ll m);
void Mpow(ll **p1,ll **ans,ll n,ll y,ll m);
pll Egcd(ll x,ll y);
ll PrimRoot(ll n,ll x);
void fft(ll a[],ll n,bool invert,ll m,ll x);
V(ll) PolyMult(V(ll) &a,V(ll) &b,ll m,ll x);

ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}

pll Egcd(ll x,ll y)
{
    if(x==0) return MP(0,1);
    pll t=Egcd(y%x,x);
    return MP(t.S-t.F*(y/x),t.F);
}

ll powM(ll x,ll y,ll m)
{
    if(y==0) return 1;
    ll p=powM(x,y/2,m)%m;
    p=(p*p)%m;
    return (y%2==0)?p:(x*p)%m;
}

ll modI(ll a, ll m)
{
    ll m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        ll q=a/m;
        ll t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}

template<typename T>
void pairsort(T a[],T b[],ll n)
{
    pair<T,T> v[n];
    REP(i,0,n)
    {
        v[i].F=a[i];
        v[i].S=b[i];
    }
    sort(v,v+n);
    REP(i,0,n)
    {
        a[i]=v[i].F;
        b[i]=v[i].S;
    }
}

ll logint(ll x,ll y)
{
    ll ans=0;
    ll a=1;
    for(ll i=0;i<=x;i++)
    {
        if(x<a)
        {
            return ans;
        }
        ans++;
        a*=y;
    }
    return -1;
}

void Miden(ll **p1,ll n)
{
    ll (*x)[n]=(ll(*)[n]) p1;
    REP(i,0,n)
    {
        REP(j,0,n)
        {
            x[i][j]=0;
        }
        x[i][i]=1;
    }
    return;
}

void Mmult(ll **p1,ll **p2,ll **ans,ll x,ll y,ll z,ll m)
{
    ll (*a)[y]=(ll (*)[y])p1;
    ll (*b)[z]=(ll (*)[z])p2;
    ll (*c)[z]=(ll (*)[z])ans;
    REP(i,0,x)
    {
        REP(j,0,z)
        {
            c[i][j]=0;
            REP(k,0,y)
            {
                c[i][j]+=a[i][k]*b[k][j];
                c[i][j]%=m;
            }
        }
    }
    return;
}

void Mpow(ll **p1,ll **ans,ll n,ll y,ll m)
{
    if(y==0)
    {
        Miden(ans,n);
        return;
    }
    ll t[n][n];
    Mpow(p1,(ll **)t,n,y/2,m);
    ll z[n][n];
    Mmult((ll **)t,(ll **)t,(ll **)z,n,n,n,m);
    if(y%2)
    {
        Mmult((ll **)z,p1,ans,n,n,n,m);
    }
    else
    {
        Miden((ll **)t,n);
        Mmult((ll **)z,(ll **)t,ans,n,n,n,m);
    }
    return;
}

ll PrimRoot(ll p,ll x)
{
    //finds primitive root of prime p greater than x(If it doesnt exist, returns 0)
    V(ll) v;
    ll t=p-1;
    REP(i,2,t+1)
    {
        if(i*i>t) break;
        if(t%i==0)
        {
            v.PB((p-1)/i);
            while(t%i==0)
            {
                t/=i;
            }
        }
    }
    if(t>1) v.PB((p-1)/t);
    REP(i,x+1,p)
    {
        ll flag=0;
        REP(j,0,v.size())
        {
            if(powM(i,v[j],p)==1)
            {
                flag=1;
                break;
            }
        }
        if(flag==0)
        {
            return i;
        }
    }

    return 0;
}

void fft(ll a[],ll n,bool invert,ll m,ll x)
{
    if(n==1) return;
    ll d[2][n>>1];
    REP(i,0,n/2)
    {
        d[0][i]=a[i<<1];
        d[1][i]=a[(i<<1)+1];
    }
    fft(d[0],n>>1,invert,m,(x*x)%m);
    fft(d[1],n>>1,invert,m,(x*x)%m);
    ll r=1;
    if(invert) x=modI(x,m);
    REP(i,0,n>>1)
    {
        a[i]=(d[0][i]+(r*d[1][i])%m)%m;
        if(a[i]<0) a[i]+=m;
        a[i+(n>>1)]=(d[0][i]-(r*d[1][i])%m)%m;
        if(a[i+(n>>1)]<0) a[i+(n>>1)]+=m;
        r*=x;
        r%=m;
    }
    if(invert)
    {
        ll inv2=modI(2,m);
        REP(i,0,n)
        {
            a[i]=(a[i]*inv2)%m;
        }
    }
    return;
}

V(ll) PolyMult(V(ll) &a,V(ll) &b,ll m,ll x)
{
    ll n=1;
    while(n<a.size()+b.size())
    {
        n<<=1;
    }
    ll fa[n]={};
    ll fb[n]={};
    ll f[n]={};
    REP(i,0,a.size())
    {
        fa[i]=a[i];
    }
    REP(i,0,b.size())
    {
        fb[i]=b[i];
    }
    ll y=powM(x,(m-1)/n,m);
    fft(fa,n,false,m,y);
    fft(fb,n,false,m,y);
    REP(i,0,n)
    {
        f[i]=(fa[i]*fb[i])%m;
    }
    fft(f,n,true,m,y);
    V(ll) v(n);
    REP(i,0,n)
    {
        v[i]=f[i];
    }
    return v;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    /*
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    */

    ll ntc=1;
    //cin>>ntc;
    REP(tc,1,ntc+1)
    {
        //cout<<"Case #"<<tc<<": ";

        ll n,k;
        cin>>n>>k;
        set<ll> st;
        REP(i,0,n)
        {
            st.insert(i);
        }
        char c;
        k/=2;
        if(k==0) k=1;
        ll t=n/k;
        REP(d,1,t+1)
        {
            REP(i,0,d)
            {
                if(i+d>=t)
                    break;
                ll j=i;
                while(j<t)
                {
                    REP(l,0,k)
                    {
                        cout<<'?'<<' '<<j*k+l+1<<endl;
                        cin>>c;
                        if(c=='Y'&&st.count(j*k+l)) st.erase(st.find(j*k+l));
                    }
                    j+=d;
                }
                cout<<'R'<<endl;
            }
        }
        cout<<'!'<<' '<<st.size()<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M1 1000000007
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b) for(ll i=b-1;i>=a;i--)
#define F first
#define S second
#define PB push_back
#define DB pop_back
#define MP make_pair
#define MT make_tuple
#define G(a,b) get<a>(b)
#define V(a) vector<a>

template<typename T>
#define o_set(T) tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

ll modI(ll a,ll m);
ll gcd(ll a,ll b);
ll powM(ll x,ll y,ll m);
template<typename T>
void pairsort(T a[],T b[],ll n);
ll logint(ll x,ll y);
void Miden(ll **p1,ll n);
void Mmult(ll **p1,ll **p2,ll **ans,ll x,ll y,ll z,ll m);
void Mpow(ll **p1,ll **ans,ll n,ll y,ll m);
pll Egcd(ll x,ll y);
ll PrimRoot(ll n,ll x);
void fft(ll a[],ll n,bool invert,ll m,ll x);
V(ll) PolyMult(V(ll) &a,V(ll) &b,ll m,ll x);

ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}

pll Egcd(ll x,ll y)
{
    if(x==0) return MP(0,1);
    pll t=Egcd(y%x,x);
    return MP(t.S-t.F*(y/x),t.F);
}

ll powM(ll x,ll y,ll m)
{
    if(y==0) return 1;
    ll p=powM(x,y/2,m)%m;
    p=(p*p)%m;
    return (y%2==0)?p:(x*p)%m;
}

ll modI(ll a, ll m)
{
    ll m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        ll q=a/m;
        ll t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}

template<typename T>
void pairsort(T a[],T b[],ll n)
{
    pair<T,T> v[n];
    REP(i,0,n)
    {
        v[i].F=a[i];
        v[i].S=b[i];
    }
    sort(v,v+n);
    REP(i,0,n)
    {
        a[i]=v[i].F;
        b[i]=v[i].S;
    }
}

ll logint(ll x,ll y)
{
    ll ans=0;
    ll a=1;
    for(ll i=0;i<=x;i++)
    {
        if(x<a)
        {
            return ans;
        }
        ans++;
        a*=y;
    }
    return -1;
}

void Miden(ll **p1,ll n)
{
    ll (*x)[n]=(ll(*)[n]) p1;
    REP(i,0,n)
    {
        REP(j,0,n)
        {
            x[i][j]=0;
        }
        x[i][i]=1;
    }
    return;
}

void Mmult(ll **p1,ll **p2,ll **ans,ll x,ll y,ll z,ll m)
{
    ll (*a)[y]=(ll (*)[y])p1;
    ll (*b)[z]=(ll (*)[z])p2;
    ll (*c)[z]=(ll (*)[z])ans;
    REP(i,0,x)
    {
        REP(j,0,z)
        {
            c[i][j]=0;
            REP(k,0,y)
            {
                c[i][j]+=a[i][k]*b[k][j];
                c[i][j]%=m;
            }
        }
    }
    return;
}

void Mpow(ll **p1,ll **ans,ll n,ll y,ll m)
{
    if(y==0)
    {
        Miden(ans,n);
        return;
    }
    ll t[n][n];
    Mpow(p1,(ll **)t,n,y/2,m);
    ll z[n][n];
    Mmult((ll **)t,(ll **)t,(ll **)z,n,n,n,m);
    if(y%2)
    {
        Mmult((ll **)z,p1,ans,n,n,n,m);
    }
    else
    {
        Miden((ll **)t,n);
        Mmult((ll **)z,(ll **)t,ans,n,n,n,m);
    }
    return;
}

ll PrimRoot(ll p,ll x)
{
    //finds primitive root of prime p greater than x(If it doesnt exist, returns 0)
    V(ll) v;
    ll t=p-1;
    REP(i,2,t+1)
    {
        if(i*i>t) break;
        if(t%i==0)
        {
            v.PB((p-1)/i);
            while(t%i==0)
            {
                t/=i;
            }
        }
    }
    if(t>1) v.PB((p-1)/t);
    REP(i,x+1,p)
    {
        ll flag=0;
        REP(j,0,v.size())
        {
            if(powM(i,v[j],p)==1)
            {
                flag=1;
                break;
            }
        }
        if(flag==0)
        {
            return i;
        }
    }

    return 0;
}

void fft(ll a[],ll n,bool invert,ll m,ll x)
{
    if(n==1) return;
    ll d[2][n>>1];
    REP(i,0,n/2)
    {
        d[0][i]=a[i<<1];
        d[1][i]=a[(i<<1)+1];
    }
    fft(d[0],n>>1,invert,m,(x*x)%m);
    fft(d[1],n>>1,invert,m,(x*x)%m);
    ll r=1;
    if(invert) x=modI(x,m);
    REP(i,0,n>>1)
    {
        a[i]=(d[0][i]+(r*d[1][i])%m)%m;
        if(a[i]<0) a[i]+=m;
        a[i+(n>>1)]=(d[0][i]-(r*d[1][i])%m)%m;
        if(a[i+(n>>1)]<0) a[i+(n>>1)]+=m;
        r*=x;
        r%=m;
    }
    if(invert)
    {
        ll inv2=modI(2,m);
        REP(i,0,n)
        {
            a[i]=(a[i]*inv2)%m;
        }
    }
    return;
}

V(ll) PolyMult(V(ll) &a,V(ll) &b,ll m,ll x)
{
    ll n=1;
    while(n<a.size()+b.size())
    {
        n<<=1;
    }
    ll fa[n]={};
    ll fb[n]={};
    ll f[n]={};
    REP(i,0,a.size())
    {
        fa[i]=a[i];
    }
    REP(i,0,b.size())
    {
        fb[i]=b[i];
    }
    ll y=powM(x,(m-1)/n,m);
    fft(fa,n,false,m,y);
    fft(fb,n,false,m,y);
    REP(i,0,n)
    {
        f[i]=(fa[i]*fb[i])%m;
    }
    fft(f,n,true,m,y);
    V(ll) v(n);
    REP(i,0,n)
    {
        v[i]=f[i];
    }
    return v;
}

static ll n,k;
static char c;
static set<ll> st;

int main()
{
    cin>>n>>k;
    if(n==1)
    {
        cout<<"! 1"<<endl;
        return 0;
    }
    REP(i,1,n+1) st.insert(i);
    ll t=n/k;
    REP(l,1,n+1)
    {
        cout<<'?'<<' '<<l<<endl;
        cin>>c;
        if(c=='Y'&&st.count(l)) st.erase(st.find(l));
    }
    cout<<'R'<<endl;
    REP(i,0,t)
    {
        REP(j,i+1,t)
        {
            REP(l,1,k+1)
            {
                cout<<'?'<<' '<<i*k+l<<endl;
                cin>>c;
            }
            REP(l,1,k+1)
            {
                cout<<'?'<<' '<<j*k+l<<endl;
                cin>>c;
                if(c=='Y'&&st.count(j*k+l)) st.erase(st.find(j*k+l));
            }
            if(k>1)
            {
                REPI(l,1,k+1)
                {
                    cout<<'?'<<' '<<i*k+l<<endl;
                    cin>>c;
                }
                REP(l,1,k+1)
                {
                    cout<<'?'<<' '<<j*k+l<<endl;
                    cin>>c;
                    if(c=='Y'&&st.count(j*k+l)) st.erase(st.find(j*k+l));
                }
            }
        }
    }
    cout<<'!'<<' '<<st.size()<<endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M1 1000000007
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b) for(ll i=b-1;i>=a;i--)
#define F first
#define S second
#define PB push_back
#define DB pop_back
#define MP make_pair
#define MT make_tuple
#define G(a,b) get<a>(b)
#define V(a) vector<a>

template<typename T>
#define o_set(T) tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

ll modI(ll a,ll m);
ll gcd(ll a,ll b);
ll powM(ll x,ll y,ll m);
template<typename T>
void pairsort(T a[],T b[],ll n);
ll logint(ll x,ll y);
void Miden(ll **p1,ll n);
void Mmult(ll **p1,ll **p2,ll **ans,ll x,ll y,ll z,ll m);
void Mpow(ll **p1,ll **ans,ll n,ll y,ll m);
pll Egcd(ll x,ll y);
ll PrimRoot(ll n,ll x);
void fft(ll a[],ll n,bool invert,ll m,ll x);
V(ll) PolyMult(V(ll) &a,V(ll) &b,ll m,ll x);

ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}

pll Egcd(ll x,ll y)
{
    if(x==0) return MP(0,1);
    pll t=Egcd(y%x,x);
    return MP(t.S-t.F*(y/x),t.F);
}

ll powM(ll x,ll y,ll m)
{
    if(y==0) return 1;
    ll p=powM(x,y/2,m)%m;
    p=(p*p)%m;
    return (y%2==0)?p:(x*p)%m;
}

ll modI(ll a, ll m)
{
    ll m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        ll q=a/m;
        ll t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}

template<typename T>
void pairsort(T a[],T b[],ll n)
{
    pair<T,T> v[n];
    REP(i,0,n)
    {
        v[i].F=a[i];
        v[i].S=b[i];
    }
    sort(v,v+n);
    REP(i,0,n)
    {
        a[i]=v[i].F;
        b[i]=v[i].S;
    }
}

ll logint(ll x,ll y)
{
    ll ans=0;
    ll a=1;
    for(ll i=0;i<=x;i++)
    {
        if(x<a)
        {
            return ans;
        }
        ans++;
        a*=y;
    }
    return -1;
}

void Miden(ll **p1,ll n)
{
    ll (*x)[n]=(ll(*)[n]) p1;
    REP(i,0,n)
    {
        REP(j,0,n)
        {
            x[i][j]=0;
        }
        x[i][i]=1;
    }
    return;
}

void Mmult(ll **p1,ll **p2,ll **ans,ll x,ll y,ll z,ll m)
{
    ll (*a)[y]=(ll (*)[y])p1;
    ll (*b)[z]=(ll (*)[z])p2;
    ll (*c)[z]=(ll (*)[z])ans;
    REP(i,0,x)
    {
        REP(j,0,z)
        {
            c[i][j]=0;
            REP(k,0,y)
            {
                c[i][j]+=a[i][k]*b[k][j];
                c[i][j]%=m;
            }
        }
    }
    return;
}

void Mpow(ll **p1,ll **ans,ll n,ll y,ll m)
{
    if(y==0)
    {
        Miden(ans,n);
        return;
    }
    ll t[n][n];
    Mpow(p1,(ll **)t,n,y/2,m);
    ll z[n][n];
    Mmult((ll **)t,(ll **)t,(ll **)z,n,n,n,m);
    if(y%2)
    {
        Mmult((ll **)z,p1,ans,n,n,n,m);
    }
    else
    {
        Miden((ll **)t,n);
        Mmult((ll **)z,(ll **)t,ans,n,n,n,m);
    }
    return;
}

ll PrimRoot(ll p,ll x)
{
    //finds primitive root of prime p greater than x(If it doesnt exist, returns 0)
    V(ll) v;
    ll t=p-1;
    REP(i,2,t+1)
    {
        if(i*i>t) break;
        if(t%i==0)
        {
            v.PB((p-1)/i);
            while(t%i==0)
            {
                t/=i;
            }
        }
    }
    if(t>1) v.PB((p-1)/t);
    REP(i,x+1,p)
    {
        ll flag=0;
        REP(j,0,v.size())
        {
            if(powM(i,v[j],p)==1)
            {
                flag=1;
                break;
            }
        }
        if(flag==0)
        {
            return i;
        }
    }

    return 0;
}

void fft(ll a[],ll n,bool invert,ll m,ll x)
{
    if(n==1) return;
    ll d[2][n>>1];
    REP(i,0,n/2)
    {
        d[0][i]=a[i<<1];
        d[1][i]=a[(i<<1)+1];
    }
    fft(d[0],n>>1,invert,m,(x*x)%m);
    fft(d[1],n>>1,invert,m,(x*x)%m);
    ll r=1;
    if(invert) x=modI(x,m);
    REP(i,0,n>>1)
    {
        a[i]=(d[0][i]+(r*d[1][i])%m)%m;
        if(a[i]<0) a[i]+=m;
        a[i+(n>>1)]=(d[0][i]-(r*d[1][i])%m)%m;
        if(a[i+(n>>1)]<0) a[i+(n>>1)]+=m;
        r*=x;
        r%=m;
    }
    if(invert)
    {
        ll inv2=modI(2,m);
        REP(i,0,n)
        {
            a[i]=(a[i]*inv2)%m;
        }
    }
    return;
}

V(ll) PolyMult(V(ll) &a,V(ll) &b,ll m,ll x)
{
    ll n=1;
    while(n<a.size()+b.size())
    {
        n<<=1;
    }
    ll fa[n]={};
    ll fb[n]={};
    ll f[n]={};
    REP(i,0,a.size())
    {
        fa[i]=a[i];
    }
    REP(i,0,b.size())
    {
        fb[i]=b[i];
    }
    ll y=powM(x,(m-1)/n,m);
    fft(fa,n,false,m,y);
    fft(fb,n,false,m,y);
    REP(i,0,n)
    {
        f[i]=(fa[i]*fb[i])%m;
    }
    fft(f,n,true,m,y);
    V(ll) v(n);
    REP(i,0,n)
    {
        v[i]=f[i];
    }
    return v;
}

static ll n,k;
static char c;
static set<ll> st;

int main()
{
    cin>>n>>k;
    if(n==1)
    {
        cout<<"! 1"<<endl;
        return 0;
    }
    REP(i,1,n+1) st.insert(i);
    ll t=n/k;
    if(t==1)
    {
        REP(l,1,k+1)
        {
            cout<<'?'<<' '<<l<<endl;
            cin>>c;
            if(c=='Y'&&st.count(l)) st.erase(st.find(l));
        }
    }
    REP(i,0,t)
    {
        REP(j,i+1,t)
        {
            REP(l,1,k+1)
            {
                cout<<'?'<<' '<<i*k+l<<endl;
                cin>>c;
                if(c=='Y'&&st.count(i*k+l)) st.erase(st.find(i*k+l));
            }
            REP(l,1,k+1)
            {
                cout<<'?'<<' '<<j*k+l<<endl;
                cin>>c;
                if(c=='Y'&&st.count(j*k+l)) st.erase(st.find(j*k+l));
            }
            cout<<'R'<<endl;
            REPI(l,1,k+1)
            {
                cout<<'?'<<' '<<i*k+l<<endl;
                cin>>c;
            }
            REP(l,1,k+1)
            {
                cout<<'?'<<' '<<j*k+l<<endl;
                cin>>c;
                if(c=='Y'&&st.count(j*k+l)) st.erase(st.find(j*k+l));
            }
            cout<<'R'<<endl;
        }
    }
    cout<<'!'<<' '<<st.size()<<endl;

    return 0;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;
const int MAXN = 1e6+5;
bool arr[MAXN];
bool query(int curr){
    cout<<"? "<<curr<<endl;
    cout.flush();
    char x;
    cin>>x;

    return x=='Y';
}
void reset(){
    cout<<'R'<<endl;
    cout.flush();

}
int main(){
    int n,k;
    cin>>n>>k;
    int tmp = k/2;
    if(!tmp){
        tmp++;
    }
    for(int i=1;i<=n;i++){
        if(!query(i)){
            arr[i] = 1;
        }
        if(k==1||(i+1)%k == 1){

            reset();
        }
    }
    int K= k;
    k=tmp;

    for(int i=1;i<=(n/k);i++){
        int st = i+1;
        if(i%2 == 1){
            st++;
            if(K==1){
                st--;
            }
        }

        for(int j=st;j<=(n/k);j++){
            for(int x=(i-1)*k + 1;x<=i*k && x<=n;x++){
                if(arr[x]){

                    query(x);
                }
            }

            for(int x=(j-1)*k + 1;x<=n && x<=(j*k);x++){
                if(arr[x]){
                    if(query(x)){
                        arr[x] = 0;
                    }
                }
            }
            if(i!=(n/k)-1){
                reset();
            }
        }
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
        if(arr[i]){
            ans++;
        }
    }
    cout<<"! "<<ans<<endl;

}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;
const int MAXN = 1e6+5;
bool arr[MAXN];
bool query(int curr){
    cout<<"? "<<curr<<endl;
    cout.flush();
    char x;
    cin>>x;

    return x=='Y';
}
void reset(){
    cout<<'R'<<endl;
    cout.flush();

}
int main(){
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        arr[i] = 1;
    }
    for(int i=1;i<=(n/k);i++){
        int st=i-1;

        int del = 0;
        reset();
        for(int cnt =1 ;cnt<=(n/k);cnt++){
            st = (st+del+(n/k))%(n/k);
            for(int x=(st)*k+1;x<=(st+1)*k;x++){
                if(arr[x]){
                    if(query(x)){
                        arr[x] = 0;
                    }
                }
            }
            if(del<0){
                del = -del;
            }else if(del>0){
                del++;
                del=-del;
            }else{
                del--;
            }

        }
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
        if(arr[i]){
            ans++;
        }
    }
    cout<<"! "<<ans<<endl;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;
const int MAXN = 1e6+5;
bool arr[MAXN];
bool query(int curr){
    cout<<"? "<<curr<<endl;
    cout.flush();
    char x;
    cin>>x;

    return x=='Y';
}
void reset(){
    cout<<'R'<<endl;
    cout.flush();

}
int main(){
    int n,k;
    cin>>n>>k;
    int tmp = k/2;
    if(!tmp){
        tmp++;
    }
    for(int i=1;i<=n;i++){
        if(!query(i)){
            arr[i] = 1;
        }
        if(k==1||(i+1)%k == 1){

            reset();
        }
    }
    k=tmp;
    for(int i=1;i<=(n/k);i++){
        int st = i+1;
        if(i%2 == 1){
            st++;
            if(k==1){
                st--;
            }
        }

        for(int j=st;j<=(n/k);j++){
            for(int x=(i-1)*k + 1;x<=i*k && x<=n;x++){
                if(arr[x]){

                    query(x);
                }
            }

            for(int x=(j-1)*k + 1;x<=n && x<=(j*k);x++){
                if(arr[x]){
                    if(query(x)){
                        arr[x] = 0;
                    }
                }
            }
            if(i!=(n/k)-1){
                reset();
            }
        }
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
        if(arr[i]){
            ans++;
        }
    }
    cout<<"! "<<ans<<endl;

}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;
const int MAXN = 1e6+5;
bool arr[MAXN];
bool query(int curr){
    cout<<"? "<<curr<<endl;
    cout.flush();
    char x;
    cin>>x;

    return x=='Y';
}
void reset(){
    cout<<'R'<<endl;
    cout.flush();

}
int main(){
    int n,k;
    cin>>n>>k;
    int tmp = k/2;
    if(!tmp){
        tmp++;
    }
    for(int i=1;i<=n;i++){
        if(!query(i)){
            arr[i] = 1;
        }
        if(k==1||(i+1)%k == 1){

            reset();
        }
    }
    k=tmp;
    for(int i=1;i<=(n/k);i++){
        int st = i+1;
        if(i%2 == 1){
            st++;
        }
        for(int j=st;j<=(n/k);j++){
            for(int x=(i-1)*k + 1;x<=i*k && x<=n;x++){
                if(arr[x]){

                    query(x);
                }
            }

            for(int x=(j-1)*k + 1;x<=n && x<=(j*k);x++){
                if(arr[x]){
                    if(query(x)){
                        arr[x] = 0;
                    }
                }
            }
            reset();
        }
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
        if(arr[i]){
            ans++;
        }
    }
    cout<<"! "<<ans<<endl;

}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;
const int MAXN = 1e6+5;
bool arr[MAXN];
bool query(int curr){
    cout<<"? "<<curr<<endl;
    cout.flush();
    char x;
    cin>>x;

    return x=='Y';
}
void reset(){
    cout<<'R'<<endl;
    cout.flush();

}
int main(){
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        arr[i] = 1;
    }
    for(int i=1;i<=(n/k);i++){
        int st=i-1;

        int del = 0;
        for(int cnt =1 ;cnt<=(n/k);cnt++){
            st = (st+del+(n/k))%(n/k);
            for(int x=(st)*k+1;x<=(st+1)*k;x++){
                if(arr[x]){
                    if(query(x)){
                        arr[x] = 0;
                    }
                }
            }
            if(del<0){
                del = -del;
            }else if(del>0){
                del++;
                del=-del;
            }else{
                del--;
            }

        }
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
        if(arr[i]){
            ans++;
        }
    }
    cout<<"! "<<ans<<endl;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;
const int MAXN = 1e6+5;
bool arr[MAXN];
bool query(int curr){
    cout<<"? "<<curr<<endl;
    cout.flush();
    char x;
    cin>>x;

    return x=='Y';
}
void reset(){
    cout<<'R'<<endl;
    cout.flush();

}
int main(){
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        arr[i] = 1;
    }
    for(int i=1;i<=(n/k);i++){
        int st=i;

        int del = 0;
        for(int cnt =1 ;cnt<=(n/k);cnt++){
            st = (st+del+(n/k))%(n/k);
            for(int x=(st)*k+1;x<=(st+1)*k;x++){
                if(arr[x]){
                    if(query(x)){
                        arr[x] = 0;
                    }
                }
            }
            if(del<0){
                del = -del;
            }else if(del>0){
                del++;
                del=-del;
            }else{
                del--;
            }

        }
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
        if(arr[i]){
            ans++;
        }
    }
    cout<<"! "<<ans<<endl;
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;
const int MAXN = 1e6+5;
bool arr[MAXN];
bool query(int curr){
    cout<<"? "<<curr<<endl;
    cout.flush();
    char x;
    cin>>x;

    return x=='Y';
}
void reset(){
    cout<<'R'<<endl;
    cout.flush();

}
int main(){
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        arr[i] = 1;
    }
    for(int i=1;i<=(n/k);i++){
        int st=i-1;
        int curr= i-1;
        int del = 0;
        reset();
        for(int cnt =1 ;cnt<=(n/k);cnt++){
            st = (curr+del+(n/k))%(n/k);
            for(int x=(st)*k+1;x<=(st+1)*k;x++){
                if(arr[x]){
                    if(query(x)){
                        arr[x] = 0;
                    }
                }
            }
            if(del<0){
                del = -del;
            }else if(del>0){
                del++;
                del=-del;
            }else{
                del--;
            }

        }
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
        if(arr[i]){
            ans++;
        }
    }
    cout<<"! "<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int n,K;
bool ban[1030];
inline bool query(int x)
{
	printf("? %d\n",x);
	fflush(stdout);
	char c[5];
	scanf("%s",c);
	if(c[0]=='E')exit(0);
	return c[0]=='Y';
}
inline void reset()
{
	puts("R");
	fflush(stdout);
}
int main()
{
	scanf("%d%d",&n,&K);
	if(n==1&&K==1)
	{
		puts("! 1");
		return 0;
	}
	for(int i=1;i<=n;i++)
		if(query(i))ban[i]=1;
	int blk=max(K/2,1);
	int blkcnt=n/blk;
	for(int i=0;i<blkcnt/2;i++)
	{
		reset();
		for(int j=0;j<n;j++)
		{
			int p;
			if(j&1)p=-((j+1)>>1);
			else p=(j>>1);
			p=((i+p)%blkcnt+blkcnt)%blkcnt;
			for(int k=p*blk+1;k<=(p+1)*blk;k++)if(query(k))ban[k]=1;
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++)cnt+=!ban[i];
	printf("! %d\n",cnt);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,K;
bool ban[1030];
inline bool query(int x)
{
	printf("? %d\n",x);
	fflush(stdout);
	char c[5];
	scanf("%s",c);
	if(c[0]=='E')exit(0);
	return c[0]=='Y';
}
inline void reset()
{
	puts("R");
	fflush(stdout);
}
int main()
{
	scanf("%d%d",&n,&K);
	if(n==1&&K==1)
	{
		puts("! 1");
		return 0;
	}
	for(int i=1;i<=n;i++)
		if(query(i))ban[i]=1;
	int blk=max(K/2,1);
	int blkcnt=n/blk;
	for(int i=0;i<blkcnt/2;i++)
	{
		reset();
		for(int j=0;j<blkcnt;j++)
		{
			int p;
			if(j&1)p=-((j+1)>>1);
			else p=(j>>1);
			if(j==1||j==2)continue;
			p=((i+p)%blkcnt+blkcnt)%blkcnt;
			for(int k=p*blk+1;k<=(p+1)*blk;k++)if(query(k))ban[k]=1;
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++)cnt+=!ban[i];
	printf("! %d\n",cnt);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,K;
bool ban[1030];
inline bool query(int x)
{
	printf("? %d\n",x);
	fflush(stdout);
	char c[5];
	scanf("%s",c);
	if(c[0]=='E')exit(0);
	return c[0]=='Y';
}
inline void reset()
{
	puts("R");
	fflush(stdout);
}
int main()
{
	scanf("%d%d",&n,&K);
	if(n==1&&K==1)
	{
		puts("! 1");
		return 0;
	}
	for(int i=1;i<=n;i++)
		if(query(i))ban[i]=1;
	int blk=max(K/2,1);
	int blkcnt=n/blk;
	for(int i=0;i<blkcnt/2;i++)
	{
		reset();
		for(int j=1;j<blkcnt;j++)
		{
			int p;
			if(j&1)p=-((j+1)>>1);
			else p=(j>>1);
			p=((i+p)%blkcnt+blkcnt)%blkcnt;
			for(int k=p*blk+1;k<=(p+1)*blk;k++)if(query(k))ban[k]=1;
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++)cnt+=!ban[i];
	printf("! %d\n",cnt);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,K;
bool ban[1030];
inline bool query(int x)
{
	printf("? %d\n",x);
	fflush(stdout);
	char c[5];
	scanf("%s",c);
	if(c[0]=='E')exit(0);
	return c[0]=='Y';
}
inline void reset()
{
	puts("R");
	fflush(stdout);
}
int main()
{
	scanf("%d%d",&n,&K);
	if(n==1&&K==1)
	{
		puts("! 1");
		return 0;
	}
	for(int i=1;i<=n;i++)
		if(query(i))ban[i]=1;
	int blk=max(K/2,1);
	int blkcnt=n/blk;
	for(int i=0;i<blkcnt/2;i++)
	{
		reset();
		for(int j=0;j<n;j++)
		{
			int p;
			if(j&1)p=-((j+1)>>1);
			else p=(j>>1);
			if(j==1||j==2)continue;
			p=((i+p)%blkcnt+blkcnt)%blkcnt;
			for(int k=p*blk+1;k<=(p+1)*blk;k++)if(query(k))ban[k]=1;
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++)cnt+=!ban[i];
	printf("! %d\n",cnt);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,K;
bool ban[1030];
inline bool query(int x)
{
	printf("? %d\n",x);
	fflush(stdout);
	char c[5];
	scanf("%s",c);
	if(c[0]=='E')exit(0);
	return c[0]=='Y';
}
inline void reset()
{
	puts("R");
	fflush(stdout);
}
int main()
{
	scanf("%d%d",&n,&K);
	if(n==1&&K==1)
	{
		puts("! 1");
		return 0;
	}
	for(int i=1;i<=n;i++)
		if(query(i))ban[i]=1;
	int blk=max(K/2,1);
	int blkcnt=n/blk;
	for(int i=0;i<blkcnt/2;i++)
	{
		reset();
		for(int j=1;j<blkcnt;j++)
		{
			int p;
			if(j&1)p=-((j+1)>>1);
			else p=(j>>1);
			p=((i+p)%blkcnt+blkcnt)%blkcnt;
			for(int k=p*blk+1;k<=(p+1)*blk;k++)if(!ban[k]&&query(k))ban[k]=1;
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++)cnt+=!ban[i];
	printf("! %d\n",cnt);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,K;
bool ban[1030];
inline bool query(int x)
{
	printf("? %d\n",x);
	fflush(stdout);
	char c[5];
	scanf("%s",c);
	if(c[0]=='E')exit(0);
	return c[0]=='Y';
}
inline void reset()
{
	puts("R");
	fflush(stdout);
}
int main()
{
	scanf("%d%d",&n,&K);
	if(n==1&&K==1)
	{
		puts("! 1");
		return 0;
	}
//	for(int i=1;i<=n;i++)
//		if(query(i))ban[i]=1;
	int blk=max(K/2,1);
	int blkcnt=n/blk;
	for(int i=0;i<blkcnt/2;i++)
	{
		reset();
		for(int j=0;j<blkcnt;j++)
		{
			int p;
			if(j&1)p=-((j+1)>>1);
			else p=(j>>1);
			p=((i+p)%blkcnt+blkcnt)%blkcnt;
			for(int k=p*blk+1;k<=(p+1)*blk;k++)if(!ban[k]&&query(k))ban[k]=1;
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++)cnt+=!ban[i];
	printf("! %d\n",cnt);
	return 0;
}


// Why am I so dumb? :c
// chrono::system_clock::now().time_since_epoch().count()

#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()

#define fi first
#define se second

using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
typedef pair<int, int> pii;
//template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int MAXN = 1050;
const bool SEND = 1;

vector<int> V[MAXN];

int alive[MAXN];

int n, k;

namespace Fake {
    int arr[MAXN];
    deque<int> Q;

    void prep() {
        for (int i = 1; i <= n; ++i) {
            scanf("%d", &arr[i]);
        }
    }

    int add(int x) {
        bool ret = 0;

        for (int y : Q) {
            if (arr[y] == arr[x]) {
                ret = 1;
            }
        }

        Q.pb(x);

        if (Q.size() > k) {
            Q.pop_back();
        }

        return ret;
    }

    void reset() {
        while (!Q.empty()) {
            Q.pop_back();
        }
    }
};

int add(int x) {
    printf("? %d\n", ++x);
    fflush(stdout);

    if (!SEND) {
        return Fake::add(x);
    }
    else {
        char c;
        scanf(" %c", &c);
        return c == 'Y';
    }
}

void reset() {
    printf("R\n");
    fflush(stdout);

    if (!SEND) {
        Fake::reset();
    }
}

void solve() {
    scanf("%d %d", &n, &k);

    if (!SEND) {
        Fake::prep();
    }

    int cnt = n / k;

    for (int i = 0; i < n; ++i) {
        alive[i] = 1;
    }

    for (int i = 0; i < cnt; ++i) {
        int delta = 0;
        reset();

        for (int j = 0; j < cnt; ++j) {
            int cur = (i + delta + cnt) % cnt;
            int st = cur * k;

            for (int ii = st; ii < st + k; ++ii) {
                if (alive[ii]) {
                    if (add(ii)) {
                        alive[ii] = 0;
                    }
                }
            }

            if (delta >= 0) {
                ++delta;
            }

            delta *= -1;
        }
    }

    printf("! %d\n", accumulate(alive, alive + n, 0));
    fflush(stdout);
}

int main() {
    int tt = 1;

    while (tt--) {
        solve();
    }

    return 0;
}


#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<bitset>
#include<functional>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<random>
#include<ctime>
#include<complex>
using namespace std;
typedef long long LL;
mt19937 gene(233);
typedef complex<double> Complex;
#define fi first
#define se second
#define ins insert
#define pb push_back
inline char GET_CHAR(){
	const int maxn = 131072;
	static char buf[maxn],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++;
}
inline int getInt() {
	int res(0);
	char c = getchar();
	while(c < '0') c = getchar();
	while(c >= '0') {
		res = res * 10 + (c - '0');
		c = getchar();
	}
	return res;
}

inline int fastpo(int x, int n, int mod) {
	int res(1);
	while(n) {
		if(n & 1) {
			res = res * (LL)x % mod;
		}
		x = x * (LL) x % mod;
		n /= 2;
	}
	return res;
}

inline string itoa(int x, int width = 0) {
  string res;
  if(x == 0) res.push_back('0');
  while(x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  while((int)res.size() < width) res.push_back('0');
  reverse(res.begin(), res.end());
  return res;
}

const int N = 300033;
const int LOG = 20;
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
int n, k;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ext[N];
deque<int> q;
int t[N];
int debug = 0;
void reset() {
	if(debug) {
		q.clear();
	}else {
		cout << "R" << endl;
	}
}
int cq = 0;
int ask(int i) {
	if(debug) {
		cq++;
		bool res = find(q.begin(), q.end(), t[i]) != q.end();
		q.push_back(t[i]);
		if((int)q.size() > k) q.pop_front();
		return res;
	}else {
		cout << "? " << i << endl;
		string st;
		cin >> st;
		return st == "Y";
	}
}
void calc(int le, int ri) {
	for(int delta(1); delta <= n / k - 1; delta++) {
		reset();
		for(int i(le); i <= ri; i += delta * k) {
			for(int l = i; l <= min(i + k - 1, ri); l++) {
				if(ext[l]) ext[l] = !ask(l);
			}
		}
	}
	for(int delta(1); delta <= n / k - 1; delta++) {
		reset();
		for(int i(le); i <= ri; i += delta * k) {
			for(int l = min(i + k - 1, ri); l >= i; l--) {
				if(ext[l]) ext[l] = !ask(l);
			}
		}
	}
}
int main() {
	if(debug) {
		n = 16; k = 4;
		for(int i(1); i <= n; i++) {
			t[i] = i;
			printf("t[%d] = %d\n", i, t[i]);
		}
		for(int i(1); i <= n; i++) {
			ext[t[i]] = 1;
		}
		int ans = 0;
		for(int i(1); i <= n; i++) ans += ext[i];
		printf("std = %d\n", ans);
	}else {
		cin >> n >> k;
	}
	for(int i(1); i <= n; i++) ext[i] = 1;
	calc(1, n);
	int cnt = 0;
	for(int i(1); i <= n; i++) cnt += ext[i];
	cout << "! " << cnt << endl;
	if(debug) cout << "cq = " << cq << endl;
}


#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<bitset>
#include<functional>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<random>
#include<ctime>
#include<complex>
using namespace std;
typedef long long LL;
mt19937 gene(233);
typedef complex<double> Complex;
#define fi first
#define se second
#define ins insert
#define pb push_back
inline char GET_CHAR(){
	const int maxn = 131072;
	static char buf[maxn],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++;
}
inline int getInt() {
	int res(0);
	char c = getchar();
	while(c < '0') c = getchar();
	while(c >= '0') {
		res = res * 10 + (c - '0');
		c = getchar();
	}
	return res;
}

inline int fastpo(int x, int n, int mod) {
	int res(1);
	while(n) {
		if(n & 1) {
			res = res * (LL)x % mod;
		}
		x = x * (LL) x % mod;
		n /= 2;
	}
	return res;
}

inline string itoa(int x, int width = 0) {
  string res;
  if(x == 0) res.push_back('0');
  while(x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  while((int)res.size() < width) res.push_back('0');
  reverse(res.begin(), res.end());
  return res;
}

const int N = 300033;
const int LOG = 20;
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
int n, k;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ext[N];
deque<int> q;
int t[N];
int debug = 0;
void reset() {
	if(debug) {
		q.clear();
	}else {
		cout << "R" << endl;
	}
}
int cq = 0;
int ask(int i) {
	if(debug) {
		cq++;
		bool res = find(q.begin(), q.end(), t[i]) != q.end();
		q.push_back(t[i]);
		if((int)q.size() > k) q.pop_front();
		return res;
	}else {
		cout << "? " << i << endl;
		string st;
		cin >> st;
		return st == "Y";
	}
}
void calc(int le, int ri) {

	if(ri == k) {
		for(int i(1); i <= k; i++) {
			ext[i] = !ask(i);
		}
		return;
	}
	for(int delta(1); delta <= n / k - 1; delta++) {
		reset();
		for(int s = 0; s < delta; s++) {
			if(le + s * k + delta * k > ri) continue;
			for(int i(le + s * k); i <= ri; i += delta * k) {
				for(int l = i; l <= min(i + k - 1, ri); l++) {
					if(ext[l]) ext[l] = !ask(l);
				}
			}
		}
		//cout << cq << endl;
	}
	for(int delta(1); delta <= n / k - 1; delta++) {
		reset();
		for(int s = 0; s < delta; s++) {
			if(le + s * k + delta * k > ri) continue;
			for(int i(le + s * k); i <= ri; i += delta * k) {
				for(int l = min(i + k - 1, ri); l >= i; l--) {
					if(ext[l]) ext[l] = !ask(l);
				}
			}
		}
	}
}
int main() {
	if(debug) {
		n = 16; k = 1;
		for(int i(1); i <= n; i++) {
			t[i] = i;//gene() % n + 1;
			printf("t[%d] = %d\n", i, t[i]);
		}
		for(int i(1); i <= n; i++) {
			ext[t[i]] = 1;
		}
		int ans = 0;
		for(int i(1); i <= n; i++) ans += ext[i];
		printf("std = %d\n", ans);
	}else {
		cin >> n >> k;
	}
	for(int i(1); i <= n; i++) ext[i] = 1;
	calc(1, n);
	int cnt = 0;
	for(int i(1); i <= n; i++) cnt += ext[i];
	cout << "! " << cnt << endl;
	if(debug) cout << "cq = " << cq << endl;
}


#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<bitset>
#include<functional>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<random>
#include<ctime>
#include<complex>
using namespace std;
typedef long long LL;
mt19937 gene(233);
typedef complex<double> Complex;
#define fi first
#define se second
#define ins insert
#define pb push_back
inline char GET_CHAR(){
	const int maxn = 131072;
	static char buf[maxn],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++;
}
inline int getInt() {
	int res(0);
	char c = getchar();
	while(c < '0') c = getchar();
	while(c >= '0') {
		res = res * 10 + (c - '0');
		c = getchar();
	}
	return res;
}

inline int fastpo(int x, int n, int mod) {
	int res(1);
	while(n) {
		if(n & 1) {
			res = res * (LL)x % mod;
		}
		x = x * (LL) x % mod;
		n /= 2;
	}
	return res;
}

inline string itoa(int x, int width = 0) {
  string res;
  if(x == 0) res.push_back('0');
  while(x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  while((int)res.size() < width) res.push_back('0');
  reverse(res.begin(), res.end());
  return res;
}

const int N = 300033;
const int LOG = 20;
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
int n, k;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ext[N];
deque<int> q;
int t[N];
int debug = 0;
void reset() {
	if(debug) {
		q.clear();
	}else {
		cout << "R" << endl;
	}
}
int cq = 0;
int ask(int i) {
	if(debug) {
		cq++;
		bool res = find(q.begin(), q.end(), t[i]) != q.end();
		q.push_back(t[i]);
		if((int)q.size() > k) q.pop_front();
		return res;
	}else {
		cout << "? " << i << endl;
		string st;
		cin >> st;
		return st == "Y";
	}
}
void calc(int le, int ri) {

	if(ri == k) {
		for(int i(1); i <= k; i++) {
			ext[i] = !ask(i);
		}
		return;
	}
	for(int delta(1); delta <= n / k - 1; delta++) {
		reset();
		for(int i(le); i <= ri; i += delta * k) {
			for(int l = i; l <= min(i + k - 1, ri); l++) {
				if(ext[l]) ext[l] = !ask(l);
			}
		}
	}
	for(int delta(1); delta <= n / k - 1; delta++) {
		reset();
		for(int i(le); i <= ri; i += delta * k) {
			for(int l = min(i + k - 1, ri); l >= i; l--) {
				if(ext[l]) ext[l] = !ask(l);
			}
		}
	}
}
int main() {
	if(debug) {
		n = 8; k = 8;
		for(int i(1); i <= n; i++) {
			t[i] = min(i, 6);
			printf("t[%d] = %d\n", i, t[i]);
		}
		for(int i(1); i <= n; i++) {
			ext[t[i]] = 1;
		}
		int ans = 0;
		for(int i(1); i <= n; i++) ans += ext[i];
		printf("std = %d\n", ans);
	}else {
		cin >> n >> k;
	}
	for(int i(1); i <= n; i++) ext[i] = 1;
	calc(1, n);
	int cnt = 0;
	for(int i(1); i <= n; i++) cnt += ext[i];
	cout << "! " << cnt << endl;
	if(debug) cout << "cq = " << cq << endl;
}


#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<bitset>
#include<functional>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<random>
#include<ctime>
#include<complex>
using namespace std;
typedef long long LL;
mt19937 gene(233);
typedef complex<double> Complex;
#define fi first
#define se second
#define ins insert
#define pb push_back
inline char GET_CHAR(){
	const int maxn = 131072;
	static char buf[maxn],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++;
}
inline int getInt() {
	int res(0);
	char c = getchar();
	while(c < '0') c = getchar();
	while(c >= '0') {
		res = res * 10 + (c - '0');
		c = getchar();
	}
	return res;
}

inline int fastpo(int x, int n, int mod) {
	int res(1);
	while(n) {
		if(n & 1) {
			res = res * (LL)x % mod;
		}
		x = x * (LL) x % mod;
		n /= 2;
	}
	return res;
}

inline string itoa(int x, int width = 0) {
  string res;
  if(x == 0) res.push_back('0');
  while(x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  while((int)res.size() < width) res.push_back('0');
  reverse(res.begin(), res.end());
  return res;
}

const int N = 300033;
const int LOG = 20;
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
int n, k;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ext[N];
deque<int> q;
int t[N];
int debug = 0;
void reset() {
	if(debug) {
		q.clear();
	}else {
		cout << "R" << endl;
	}
}
int cq = 0;
int ask(int i) {
	if(debug) {
		cq++;
		bool res = find(q.begin(), q.end(), t[i]) != q.end();
		q.push_back(t[i]);
		if((int)q.size() > k) q.pop_front();
		return res;
	}else {
		cout << "? " << i << endl;
		string st;
		cin >> st;
		return st == "Y";
	}
}
void calc(int le, int ri) {

	if(ri == k) {
		for(int i(1); i <= k; i++) {
			ext[i] = !ask(i);
		}
		return;
	}
	for(int delta(1); delta <= n / k - 1; delta++) {
		reset();
		for(int s = 0; s < delta; s++) {
			for(int i(le + s * k); i <= ri; i += delta * k) {
				for(int l = i; l <= min(i + k - 1, ri); l++) {
					if(ext[l]) ext[l] = !ask(l);
				}
			}
		}
		//cout << cq << endl;
	}
	for(int delta(1); delta <= n / k - 1; delta++) {
		reset();
		for(int s = 0; s < delta; s++) {
			for(int i(le + s * k); i <= ri; i += delta * k) {
				for(int l = min(i + k - 1, ri); l >= i; l--) {
					if(ext[l]) ext[l] = !ask(l);
				}
			}
		}
	}
}
int main() {
	if(debug) {
		n = 16; k = 4;
		for(int i(1); i <= n; i++) {
			t[i] = i;//gene() % n + 1;
			printf("t[%d] = %d\n", i, t[i]);
		}
		for(int i(1); i <= n; i++) {
			ext[t[i]] = 1;
		}
		int ans = 0;
		for(int i(1); i <= n; i++) ans += ext[i];
		printf("std = %d\n", ans);
	}else {
		cin >> n >> k;
	}
	for(int i(1); i <= n; i++) ext[i] = 1;
	calc(1, n);
	int cnt = 0;
	for(int i(1); i <= n; i++) cnt += ext[i];
	cout << "! " << cnt << endl;
	if(debug) cout << "cq = " << cq << endl;
}


#include "bits/stdc++.h"
using namespace std;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
#define cbr cerr << "hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ll(x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x,y) (lower_bound(all(x),y)-x.begin())
#define ubd(x,y) (upper_bound(all(x),y)-x.begin())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return (rng() % (y+1-x)) + x; } //inclusivesss
string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); }

typedef long long ll;
typedef long double ld;
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
typedef pair<ll,ll>pi; typedef pair<ll,pi>spi; typedef pair<pi,pi>dpi;

#define LLINF ((long long)1e18)
#define INF int(1e9+1e6)
#define MAXN (300006)
#define local 0
ll n, k, A[MAXN], Q, K;
bitset<MAXN> here, vis;
deque<ll> hmm;
bool query(ll x){
	++ x;
	cout<<"? "<<x<<endl;
	if(local){
		++ Q;
		bool inside = find(all(hmm),A[x]) != hmm.end();
		hmm.pb(A[x]);
		if(hmm.size()>k) hmm.pop_front();
		return inside;
	}
	char ch; cin>>ch;
	return ch == 'Y';
}
void reset(){
	cout<<"R"<<endl;
	if(local) hmm.clear();
}
void whole(ll x){
	FOR(i,x*k,(x+1)*k-1) if(here[i] && query(i)) here[i]=0;
}

int main(){
	FAST
	cin>>n>>k;K=k;
	if(local) FOR(i,1,n)cin>>A[i];
	if(n==1){
		cout<<"! "<<1<<endl;
		return 0;
	}
	// split into k/2
	if(k>1) k/=2;
	here.set();
	assert(n/k>1);
	assert(n/k%2==0);
	FOR(i,0,n/k/2-1){
		ll delta=0;
		vis.reset();
		while(!vis[(i+delta+n/k)%(n/k)]) {
			whole((i+delta+n/k)%(n/k));
			vis[(i+delta+n/k)%(n/k)]=1;
			if(llabs(delta) == n/k/2) break;
			if(delta<0) delta*=-1;
			else delta=-delta-1;
		}
		reset();
	}
	ll ans = 0; FOR(i,0,n-1) ans += here[i];
	cout<<"! "<<ans<<endl;
	if(local){
		cerr<<"Used: "<<Q<<'\n';
		cerr<<"Allowed: "<<3*n*n/2/K<<'\n';
	}
}


#include "bits/stdc++.h"
using namespace std;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
#define cbr cerr << "hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ll(x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x,y) (lower_bound(all(x),y)-x.begin())
#define ubd(x,y) (upper_bound(all(x),y)-x.begin())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return (rng() % (y+1-x)) + x; } //inclusivesss
string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); }

typedef long long ll;
typedef long double ld;
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
typedef pair<ll,ll>pi; typedef pair<ll,pi>spi; typedef pair<pi,pi>dpi;

#define LLINF ((long long)1e18)
#define INF int(1e9+1e6)
#define MAXN (300006)
#define local 0
ll n, k, A[MAXN];
bitset<MAXN> here, vis;
deque<ll> hmm;
bool query(ll x){
	++ x;
	cout<<"? "<<x<<endl;
	if(local){
		bool inside = find(all(hmm),A[x]) != hmm.end();
		hmm.pb(A[x]);
		if(hmm.size()>k) hmm.pop_front();
		return inside;
	}
	char ch; cin>>ch;
	return ch == 'Y';
}
void reset(){
	cout<<"R"<<endl;
	if(local) hmm.clear();
}
void whole(ll x){
	FOR(i,x*k,(x+1)*k-1) if(here[i] && query(i)) here[i]=0;
}

int main(){
	FAST
	cin>>n>>k;
	if(local) FOR(i,1,n)cin>>A[i];
	if(n==1){
		cout<<"! "<<1<<endl;
		return 0;
	}
	// split into k/2
	if(k>1) k/=2;
	here.set();
	assert(n/k>1);
	assert(n/k%2==0);
	FOR(i,0,n/2-1){
		ll delta=0;
		vis.reset();
		while(!vis[(i+delta+n/k)%(n/k)]) {
			whole((i+delta+n/k)%(n/k));
			vis[(i+delta+n/k)%(n/k)]=1;
			if(llabs(delta) == n/k/2) break;
			if(delta<0) delta*=-1;
			else delta=-delta-1;
		}
		reset();
	}
	ll ans = 0; FOR(i,0,n-1) ans += here[i];
	cout<<"! "<<ans<<endl;
}


#include "bits/stdc++.h"
using namespace std;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
#define cbr cerr << "hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ll(x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x,y) (lower_bound(all(x),y)-x.begin())
#define ubd(x,y) (upper_bound(all(x),y)-x.begin())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return (rng() % (y+1-x)) + x; } //inclusivesss
string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); }

typedef long long ll;
typedef long double ld;
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
typedef pair<ll,ll>pi; typedef pair<ll,pi>spi; typedef pair<pi,pi>dpi;

#define LLINF ((long long)1e18)
#define INF int(1e9+1e6)
#define MAXN (300006)
#define local 0
ll n, k, A[MAXN];
bitset<MAXN> here, vis;
deque<ll> hmm;
bool query(ll x){
	++ x;
	cout<<"? "<<x<<endl;
	if(local){
		bool inside = find(all(hmm),A[x]) != hmm.end();
		cerr<<"pb: "<<A[x]<<endl;
		hmm.pb(A[x]);
		if(hmm.size()>k) hmm.pop_front();
		cerr<<"ans: "<<inside<<endl;
		return inside;
	}
	char ch; cin>>ch;
	return ch == 'Y';
}
void reset(){
	cout<<"R"<<endl;
	if(local) hmm.clear();
}
void whole(ll x){
	FOR(i,x*k,(x+1)*k-1) if(here[i] && query(i)) here[i]=0;
}

int main(){
	FAST
	cin>>n>>k;
	FOR(i,1,n)cin>>A[i];
	if(n==1){
		cout<<"! "<<1<<endl;
		return 0;
	}
	// split into k/2
	if(k>1) k/=2;
	here.set();
	assert(n/k>1);
	assert(n/k%2==0);
	FOR(i,0,n-1){
		ll delta=0;
		vis.reset();
		while(!vis[(i+delta+n/k)%(n/k)]) {
			whole((i+delta+n/k)%(n/k));
			vis[(i+delta+n/k)%(n/k)]=1;
			if(llabs(delta) == n/k/2) break;
			if(delta<0) delta*=-1;
			else delta=-delta-1;
		}
		reset();
	}
	ll ans = 0; FOR(i,0,n-1) ans += here[i];
	cout<<"! "<<ans<<endl;
}


#include "bits/stdc++.h"
using namespace std;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
#define cbr cerr << "hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ll(x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x,y) (lower_bound(all(x),y)-x.begin())
#define ubd(x,y) (upper_bound(all(x),y)-x.begin())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return (rng() % (y+1-x)) + x; } //inclusivesss
string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); }

typedef long long ll;
typedef long double ld;
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
typedef pair<ll,ll>pi; typedef pair<ll,pi>spi; typedef pair<pi,pi>dpi;

#define LLINF ((long long)1e18)
#define INF int(1e9+1e6)
#define MAXN (300006)
#define local 0
ll n, k, A[MAXN];
bitset<MAXN> here, vis;
deque<ll> hmm;
bool query(ll x){
	++ x;
	cout<<"? "<<x<<endl;
	if(local){
		bool inside = find(all(hmm),A[x]) != hmm.end();
		cerr<<"pb: "<<A[x]<<endl;
		hmm.pb(A[x]);
		if(hmm.size()>k) hmm.pop_front();
		cerr<<"ans: "<<inside<<endl;
		return inside;
	}
	char ch; cin>>ch;
	return ch == 'Y';
}
void reset(){
	cout<<"R"<<endl;
	if(local) hmm.clear();
}
void whole(ll x){
	FOR(i,x*k,(x+1)*k-1) if(here[i] && query(i)) here[i]=0;
}

int main(){
	FAST
	cin>>n>>k;
	if(local) FOR(i,1,n)cin>>A[i];
	if(n==1){
		cout<<"! "<<1<<endl;
		return 0;
	}
	// split into k/2
	if(k>1) k/=2;
	here.set();
	assert(n/k>1);
	assert(n/k%2==0);
	FOR(i,0,n-1){
		ll delta=0;
		vis.reset();
		while(!vis[(i+delta+n/k)%(n/k)]) {
			whole((i+delta+n/k)%(n/k));
			vis[(i+delta+n/k)%(n/k)]=1;
			if(llabs(delta) == n/k/2) break;
			if(delta<0) delta*=-1;
			else delta=-delta-1;
		}
		reset();
	}
	ll ans = 0; FOR(i,0,n-1) ans += here[i];
	cout<<"! "<<ans<<endl;
}


#include <bits/stdc++.h>

#define itn int
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())

#define random_shuffle(...) shuffle(__VA_ARGS__, rng)
#define rand() rng()

#ifdef OLBOEB
	#define return std::cerr << __FUNCTION__ << "\n"; return
#endif  // OLBOEB

using namespace std;

inline int nxt() {
	int x;
	// scanf("%d", &x);
	cin >> x;
	return x;
}

bool ask(int x) {
	cout << "? " << x + 1 << endl;
	char c;
	cin >> c;
	return c == 'Y';
}

void forget() {
	cout << "R" << endl;
}

int main() {
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int n = nxt(), k = nxt();
	vector<char> is_unique(n, 1);
	for (int i = 0; i < n; ++i) {
		is_unique[i] = !ask(i);
		if ((i + 1) % k == 0) {
			forget();
		}
	}

	for (int d = 1; d < n / k; ++d) {
		for (int i = 0; i < d; ++i) {
			if (i + d >= n / k) {
				continue;
			}
			vector<int> not_unique;
			for (int j = i; j < n / k; j += d) {
				for (int c = 0; c < k; ++c) {
					if (is_unique[j * k + c]) {
						bool q = ask(j * k + c);
						is_unique[j * k + c] &= !q;
						if (q) {
							not_unique.push_back(j * k + c);
						}
					}
				}
			}
			forget();
			for (int j = i; j < n / k; j += d) {
				for (int c = k - 1; c >= 0; --c) {
					if (is_unique[j * k + c]) {
						bool q = ask(j * k + c);
						is_unique[j * k + c] &= !q;
						if (q) {
							not_unique.push_back(j * k + c);
						}
					}
				}
			}
			forget();
			for (int x : not_unique) {
				is_unique[x] = false;
			}
		}
	}
	int ans = 0;
	for (int i = 0; i < n; ++i) {
		ans += is_unique[i];
	}
	cout << "! " << ans << endl;

	return 0;
}


#include <bits/stdc++.h>

#define itn int
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())

#define random_shuffle(...) shuffle(__VA_ARGS__, rng)
#define rand() rng()

#ifdef OLBOEB
	#define return std::cerr << __FUNCTION__ << "\n"; return
#endif  // OLBOEB

using namespace std;

inline int nxt() {
	int x;
	// scanf("%d", &x);
	cin >> x;
	return x;
}

bool ask(int x) {
	cout << "? " << x + 1 << endl;
	char c;
	cin >> c;
	return c == 'Y';
}

void forget() {
	cout << "R" << endl;
}

int main() {
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int n = nxt(), k = nxt();
	vector<char> is_unique(n, 1);
	for (int i = 0; i < n; ++i) {
		is_unique[i] = !ask(i);
		if ((i + 1) % k == 0) {
			forget();
		}
	}

	for (int d = 1; d < n / k; ++d) {
		for (int i = 0; i < d; ++i) {
			if (i + d >= n / k) {
				continue;
			}
			for (int j = i; j < n / k; j += d) {
				for (int c = 0; c < k; ++c) {
					bool q = ask(j * k + c);
					if (j > i) {
						is_unique[j * k + c] &= !q;
					}
				}
			}
		}
		forget();
	}
	int ans = 0;
	for (int i = 0; i < n; ++i) {
		ans += is_unique[i];
	}
	cout << "! " << ans << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

const int N=2010;
int l[N],r[N],cnt,n,k,dup[N],bb[N];
char s[10];

int query(int x) {
	printf("? %d\n",x+1);
	fflush(stdout);
	scanf("%s",s);
	return s[0]=='Y';
}
void clear() { puts("R"); fflush(stdout); }

int main() {
	scanf("%d%d",&n,&k);
	int b=max(k/2,1),c=n/b;
	for (int i=0;i<c;i++) l[i]=i*b+1,r[i]=i*b+b;
	for (int d=1;d<c;d++) {
		for (int i=0;i<d&&i+d<c;i++) {
			for (int j=i;j<c;j+=d) {
				bb[j]=1;
				for (int k=l[i];k<=r[i];k++) if (query(j)) dup[j]=1;
			}
			clear();
		}
	}
	int ans=0;
	for (int i=0;i<n;i++) ans+=!dup[i];
	printf("! %d\n",ans);
	fprintf(stderr,"%d %d\n",cnt,3*n*n/2/k);
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

const int N=2010;
int l[N],r[N],cnt,n,k,dup[N],bb[N];
char s[10];

int query(int x) {
	printf("? %d\n",x);
	fflush(stdout);
	scanf("%s",s);
	return s[0]=='Y';
}
void clear() { puts("R"); fflush(stdout); }

int main() {
	scanf("%d%d",&n,&k);
	int b=max(k/2,1),c=n/b;
	for (int i=0;i<c;i++) l[i]=i*b+1,r[i]=i*b+b;
	for (int d=1;d<c;d++) {
		for (int i=0;i<d&&i+d<c;i++) {
			for (int j=i;j<c;j+=d) {
				bb[j]=1;
				for (int k=l[j];k<=r[j];k++) if (query(k)) dup[k]=1;
			}
			clear();
		}
	}
	int ans=0;
	for (int i=1;i<=n;i++) ans+=!dup[i];
	printf("! %d\n",ans);
//	fprintf(stderr,"%d %d\n",cnt,3*n*n/2/k);
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

const int N=2010;
int l[N],r[N],cnt,n,k,dup[N],bb[N];
char s[10];

int query(int x) {
	printf("? %d\n",x);
	fflush(stdout);
	scanf("%s",s);
	return s[0]=='Y';
}
void clear() { puts("R"); fflush(stdout); }

int main() {
	scanf("%d%d",&n,&k);
	int b=max(k/2,1),c=n/b;
	for (int i=0;i<c;i++) l[i]=i*b+1,r[i]=i*b+b;
	for (int d=1;d<c;d++) {
		for (int i=0;i<d&&i+d<c;i++) {
			for (int j=i;j<c;j+=d) {
				bb[j]=1;
				for (int k=l[j];k<=r[j];k++) if (query(k)) dup[j]=1;
			}
			clear();
		}
	}
	int ans=0;
	for (int i=0;i<n;i++) ans+=!dup[i];
	printf("! %d\n",ans);
//	fprintf(stderr,"%d %d\n",cnt,3*n*n/2/k);
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

const int N=2010;
int l[N],r[N],cnt,n,k,dup[N],bb[N];
char s[10];

int query(int x) {
	printf("? %d\n",x);
	fflush(stdout);
	scanf("%s",s);
	return s[0]=='Y';
}
void clear() { puts("R"); fflush(stdout); }

int main() {
	scanf("%d%d",&n,&k);
	int b=max(k/2,1),c=n/b;
	for (int i=0;i<c;i++) l[i]=i*b+1,r[i]=i*b+b;
	for (int d=1;d<c;d++) {
		for (int i=0;i<d&&i+d<c;i++) {
			for (int j=i;j<c;j+=d) {
				bb[j]=1;
				for (int k=l[j];k<=r[j];k++) if (query(k)) dup[j]=1;
			}
			clear();
		}
	}
	int ans=0;
	for (int i=1;i<=n;i++) ans+=!dup[i];
	printf("! %d\n",ans);
//	fprintf(stderr,"%d %d\n",cnt,3*n*n/2/k);
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

const int N=2010;
int l[N],r[N],cnt,n,k,dup[N],bb[N];
char s[10];

int query(int x) {
	printf("? %d\n",x+1);
	fflush(stdout);
	scanf("%s",s);
	return s[0]=='Y';
}
void clear() { puts("R"); fflush(stdout); }

int main() {
	scanf("%d%d",&n,&k);
	int b=max(k/2,1),c=n/b;
	for (int i=0;i<c;i++) l[i]=i*b+1,r[i]=i*b+b;
	for (int d=1;d<c;d++) {
		for (int i=0;i<d&&i+d<c;i++) {
			for (int j=i;j<c;j+=d) {
				bb[j]=1;
				for (int k=l[j];k<=r[j];k++) if (query(k)) dup[j]=1;
			}
			clear();
		}
	}
	int ans=0;
	for (int i=0;i<n;i++) ans+=!dup[i];
	printf("! %d\n",ans);
//	fprintf(stderr,"%d %d\n",cnt,3*n*n/2/k);
}


#include <bits/stdc++.h>
#define ll long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

using namespace std;

int n, k;

queue <int> q;

int iter = 0;

bool query(int tp, int pos = -1) {
	iter++;
	if (!tp) {
		cout << "? " << pos + 1 << endl;
		string ret;
		cin >> ret;
		return (ret == "Y");
	} else {
		cout << "R" << endl;
	}
	return false;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n >> k;

	vector <bool> alive(n, true);
	int block = (k == 1 ? 1 : k / 2);
	/*for (int s = 0; s < n; s += block) {
		for (int i = 0; i < block; i++) {
			if (query(0, s + i)) {
				alive[s + i] = false;
			}
		}
		query(1);
	}*/

	int sz = n / block;
	for (int i = 0; i < sz; i++) {
		int delta = 0;
		query(1);
		for (int j = 0; j < sz; j++) {
			int now = (i + delta + sz) % sz;
			for (int k = 0; k < block; k++) {
				int pos = now * block + k;
				if (!alive[pos]) continue;
				if (query(0, pos)) alive[pos] = false;
			}
			if (delta >= 0) delta++;
			delta = -delta;
		}
	}

	int cnt = 0;
	for (int i = 0; i < n; i++) {
		cnt += alive[i];
	}
	cout << "! " << cnt << endl;

}


#include <bits/stdc++.h>
#define ll long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

using namespace std;

int n, k;

queue <int> q;

int iter = 0;

bool query(int tp, int pos = -1) {
	iter++;
	if (!tp) {
		cout << "? " << pos + 1 << endl;
		string ret;
		cin >> ret;
		return (ret == "Y");
	} else {
		cout << "R" << endl;
	}
	return false;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n >> k;

	vector <bool> alive(n, true);
	int block = (k == 1 ? 1 : k / 2);
	/*for (int s = 0; s < n; s += block) {
		for (int i = 0; i < block; i++) {
			if (query(0, s + i)) {
				alive[s + i] = false;
			}
		}
		query(1);
	}*/

	int sz = n / block;
	for (int i = 0; i < sz; i++) {
		int delta = 0;
		for (int j = 0; j < sz; j++) {
			int now = (i + delta + sz) % sz;
			for (int k = 0; k < block; k++) {
				int pos = now * block + k;
				if (!alive[pos]) continue;
				if (query(0, pos)) alive[pos] = false;
			}
			if (delta >= 0) delta++;
			delta = -delta;
		}
	}

	int cnt = 0;
	for (int i = 0; i < n; i++) {
		cnt += alive[i];
	}
	cout << "! " << cnt << endl;

}


#include <bits/stdc++.h>
#define ll long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

using namespace std;

int n, k;

queue <int> q;

int iter = 0;

bool query(int tp, int pos = -1) {
	iter++;
	if (!tp) {
		cout << "? " << pos + 1 << endl;
		string ret;
		cin >> ret;
		return (ret == "Y");
	} else {
		cout << "R" << endl;
	}
	return false;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n >> k;

	vector <bool> alive(n, true);
	int block = k;
	/*for (int s = 0; s < n; s += block) {
		for (int i = 0; i < block; i++) {
			if (query(0, s + i)) {
				alive[s + i] = false;
			}
		}
		query(1);
	}*/

	int sz = n / block;
	for (int i = 0; i < sz; i++) {
		int delta = 0;
		query(1);
		for (int j = 0; j < sz; j++) {
			int now = (i + delta + sz) % sz;
			for (int k = 0; k < block; k++) {
				int pos = now * block + k;
				if (!alive[pos]) continue;
				if (query(0, pos)) alive[pos] = false;
			}
			if (delta >= 0) delta++;
			delta = -delta;
		}
	}

	int cnt = 0;
	for (int i = 0; i < n; i++) {
		cnt += alive[i];
	}
	cout << "! " << cnt << endl;

}


#include <bits/stdc++.h>
#define ll long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

using namespace std;

int n, k;

queue <int> q;

int iter = 0;

bool query(int tp, int pos = -1) {
	iter++;
	if (!tp) {
		cout << "? " << pos + 1 << endl;
		string ret;
		cin >> ret;
		return (ret == "Y");
	} else {
		cout << "R" << endl;
	}
	return false;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n >> k;

	vector <bool> alive(n, true);
	int block = (k == 1 ? 1 : k / 2);
	for (int s = 0; s < n; s += block) {
		for (int i = 0; i < block; i++) {
			if (query(0, s + i)) {
				alive[s + i] = false;
			}
		}
		query(1);
	}

	int sz = n / block;
	for (int i = 0; i < sz; i++) {
		int delta = 0;
		for (int j = 0; j < sz; j++) {
			int now = (i + delta + sz) % sz;
			for (int k = 0; k < block; k++) {
				int pos = now * block + k;
				if (!alive[pos]) continue;
				if (query(0, pos)) alive[pos] = false;
			}
			if (delta >= 0) delta++;
			delta = -delta;
		}
	}

	int cnt = 0;
	for (int i = 0; i < n; i++) {
		cnt += alive[i];
	}
	cout << "! " << cnt << endl;

}


#include<bits/stdc++.h>
using namespace std;
const int MAX_N=1030;
int n,k,nxt[MAX_N],top;
bool vis[MAX_N];
vector<int> a[MAX_N];
int query(int x){
	printf("? %d\n",x);
	fflush(stdout);
	static char s[15];
	scanf("%s",s);
	return s[0]=='Y';
}
void clr(){
	puts("R");
	fflush(stdout);
}
vector<int> rev(vector<int> a){
	reverse(a.begin(),a.end());
	return a;
}
void solve(vector<int> a){
	int cnt=k;
	for(auto x:a){
		vis[x]|=query(x);
		--cnt;
	}
	while(cnt--) query(a.back());
}
void dfs(int x){
	if(x>top) return;
	solve(a[x]);
	dfs(nxt[x]);
	nxt[x]++;
}
int main(){
	scanf("%d%d",&n,&k),top=n/k;
	for(int i=1;i<=top;++i){
		clr();
		for(int j=(i-1)*k+1;j<=i*k;++j)
			if(!query(j)) a[i].push_back(j);
	}
	for(int i=1;i<=top;++i) nxt[i]=i+1;
	while(1){
		int flag=0;
		for(int i=1;i<=top;++i)
			if(nxt[i]<=top){
				clr();
				dfs(i);
				flag=1;
			}
		if(!flag) break;
	}
	for(int i=1;i<=top;++i){
		reverse(a[i].begin(),a[i].end());
		nxt[i]=i+1;
	}
	while(1){
		int flag=0;
		for(int i=1;i<=top;++i)
			if(nxt[i]<=top){
				clr();
				dfs(i);
				flag=1;
			}
		if(!flag) break;
	}
	int ans=0;
//	for(int i=1;i<=n;++i) printf("(%d)",vis[i]);
	for(int i=1;i<=top;++i)
		for(auto x:a[i])
			if(!vis[x]) ++ans;
	printf("! %d\n",ans);
	return 0;
}