#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
int c[maxn][maxn];
int cs[maxn];
char s[maxn];
vector<pair<int, int> > vc;
vector<int> dvc;
const int U = 0;
const int D = 1;
const int L = 2;
const int R = 3;
inline int getD(char c) {
  if (c == 'U') return U;
  if (c == 'D') return D;
  if (c == 'L') return L;
  if (c == 'R') return R;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  int n, m, k;
  memset(cs, 0, sizeof(cs));
  memset(c, 0, sizeof(c));
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i < n + 1; ++i) {
    scanf("%s", s + 1);
    for (int j = 1; j < m + 1; ++j) {
      if (s[j] != '.') {
        ++c[i][j];
        vc.push_back(make_pair(i, j));
        dvc.push_back(getD(s[j]));
      }
    }
  }
  int sz = ((int)(vc).size());
  int x, y, d;
  int t;
  for (int j = 0; j < sz; ++j) {
    x = vc[j].first;
    y = vc[j].second;
    d = dvc[j];
    if (d == U) {
      if (x > 1 && (x & 1)) ++cs[y];
    } else if (d == L) {
      t = x - 1;
      y -= t;
      if (y > 0 && y <= m) ++cs[y];
    } else if (d == R) {
      t = x - 1;
      y += t;
      if (y > 0 && y <= m) ++cs[y];
    }
  }
  for (int j = 1; j < m + 1; ++j) printf("%d ", cs[j]);
  putchar('\n');
  return 0;
}
