#include <bits/stdc++.h>
using namespace std;
char mas[2010][2010];
int n, m, k;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
char dir[] = {'L', 'R', 'U', 'D'};
bool norm(int x, int y) { return x >= 0 && y >= 0 && x < n && y < m; }
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> mas[i][j];
  for (int j = 0; j < m; ++j) {
    int cnt = 0;
    for (int i = 1; i < n; ++i) {
      for (int t = 0; t < 4; ++t)
        if (norm(i + dx[t] * i, j + dy[t] * i)) {
          if (mas[i + dx[t] * i][j + dy[t] * i] == dir[t]) ++cnt;
        }
    }
    cout << cnt << " ";
  }
  cout << "\n";
  return 0;
}
