#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
const int MOD = 1000000007;
const double pi = acos(-1.0);
int ans[2222];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = (0); i <= (n - 1); ++i) {
    string s;
    cin >> s;
    for (int j = (0); j <= (m - 1); ++j) {
      if (s[j] == '.') continue;
      if (s[j] == 'D') continue;
      if (s[j] == 'L') {
        if (j >= i) ans[j - i]++;
      }
      if (s[j] == 'R') {
        if (i + j < m) ans[i + j]++;
      }
      if (s[j] == 'U') {
        if (i % 2 == 0) ans[j]++;
      }
    }
  }
  for (int j = (0); j <= (m - 1); ++j) cout << ans[j] << " ";
  cout << endl;
}
