#include <bits/stdc++.h>
using namespace std;
int dp[2005][2005];
int main() {
  int i, j;
  int n, m, k;
  char temp;
  cin >> n >> m >> k;
  char arr[n + 1][m + 1];
  for (i = 1; i < n + 1; i++) {
    for (j = 1; j < m + 1; j++) {
      cin >> temp;
      arr[i][j] = temp;
    }
  }
  int ind = 0;
  for (int i = 2; i <= n; i++) {
    ind++;
    for (int j = 1; j <= m; j++) {
      if (j - ind >= 1) {
        if (arr[i][j - ind] == 'R') dp[i][j]++;
      }
      if (j + ind <= m) {
        if (arr[i][j + ind] == 'L') dp[i][j]++;
      }
      if (i - ind >= 1) {
        if (arr[i - ind][j] == 'D') dp[i][j]++;
      }
      if (i + ind <= n) {
        if (arr[i + ind][j] == 'U') dp[i][j]++;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    int ans = 0;
    for (int j = 2; j <= n; j++) {
      ans = ans + dp[j][i];
    }
    cout << ans << " ";
  }
}
