#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
const long long INFll = 1ll * INF * INF;
const int MOD = 1000000007;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<string> s(n);
  for (int i = 0; i < n; ++i) cin >> s[i];
  for (int j = 0; j < m; ++j) {
    int k = 0;
    if (s[0][j] != '.') k++;
    for (int i = 1; i < n; ++i) {
      if (s[i - i][j] == 'D') k++;
      if (j - i >= 0 && s[i][j - i] == 'R') k++;
      if (j + i < m && s[i][j + i] == 'L') k++;
      if (i + i < n && s[i + i][j] == 'U') k++;
    }
    cout << k << " ";
  }
  return 0;
}
