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