#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  int N, M, K;
  cin >> N >> M >> K;
  vector<string> mat(N);
  for (int i = 0; i < N; ++i) {
    cin >> mat[i];
  }
  for (int i = 0; i < M; ++i) {
    int ans = 0;
    for (int j = 0; j < N; ++j) {
      const int dy[] = {0, 1, 0, -1};
      const int dx[] = {1, 0, -1, 0};
      const string dir = "LURD";
      for (int di = 0; di < 4; ++di) {
        int ni = i + dx[di] * j;
        int nj = j + dy[di] * j;
        if (not(0 <= ni and ni < M and 0 <= nj and nj < N)) continue;
        ans += mat[nj][ni] == dir[di];
      }
    }
    cout << ans << " \n"[i + 1 == M];
  }
  return 0;
}
