#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> v(m, 0);
  string s;
  cin >> s;
  for (int i = 1; i < n; i++) {
    cin >> s;
    for (int j = 0; j < m; j++) {
      if (s[j] == 'D' || s[j] == '.') continue;
      if (s[j] == 'L') {
        if (j - i >= 0) v[j - i]++;
      } else if (s[j] == 'R') {
        if (i + j < m) v[i + j]++;
      } else if (s[j] == 'U') {
        if (i % 2 == 0) v[j]++;
      }
    }
  }
  for (vector<int>::iterator it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) cout << " ";
    cout << *it;
  }
  cout << endl;
}
