N, M = input().strip().split() N = int(N) txt = '' for i in range(N): txt += input().strip().replace('R', '') print(len(txt))