#include int main(void){ int tate, yoko; scanf("%d%d",&tate,&yoko); int count = 0; char str[yoko]; for(int i = 0;i < tate;i ++){ scanf("%s",str); for(int j = 0;j < yoko;j ++){ if(str[j] != 'R'){ count++; } } } printf("%d",count); }