#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
char mpt[2005][2005];
int dp[maxn][maxn];
int col[maxn];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%s", mpt[i] + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (mpt[i][j] == 'L') {
        int w = i - 1;
        if (j - w >= 1) dp[i][j - w] += 1;
      } else if (mpt[i][j] == 'R') {
        int w = i - 1;
        if (j + w <= m) dp[i][j + w] += 1;
      } else if (mpt[i][j] == 'U' && i % 2 == 1) {
        col[j] += 1;
      } else if (mpt[i][j] == 'D') {
        continue;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      col[j] += dp[i][j];
    }
  }
  for (int i = 1; i <= m; i++) printf("%d ", col[i]);
  printf("\n");
  return 0;
}
