#include using namespace std; int main() { int n, m; cin >> n >> m; int ret = 0; for (int i = 0; i < n; i++) { string s; cin >> s; for (int j = 0; j < m; j++) { if (s[j] != 'R')ret++; } } cout << ret << endl; return 0; }