// yukicoder: No.712 赤旗 // 2019.5.2 bal4u #include #if 1 #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) #else #define gc() getchar() #define pc(c) putchar(c) #endif int in() // 整数の入力(負数に対応) { int n = 0, c = gc(); do n = 10*n + (c & 0xf), c = gc(); while (c >= '0'); return n; } int main() { int N, M, m, s; s = 0, N = in(), M = in(); while (N--) { m = M; while (m--) if (gc() != 'R') s++; gc(); } printf("%d\n", s); return 0; }