#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
const int infi = 1e9;
const long long Linfi = (long long)1e18;
const long long MOD = 1000000007;
int c1 = 9973;
struct nhen {
  int x, y, direc;
  nhen() {}
  nhen(int _x, int _y, int _direc) {
    x = _x;
    y = _y;
    direc = _direc;
  }
};
int n, m, k, cnt = 0;
string s[2005];
nhen P[4000005];
int ans[2005];
void solve() {
  for (int i = 1; i <= cnt; i++) {
    if (P[i].direc == 1) {
      if (P[i].y + P[i].x - 1 <= m) ans[P[i].x + P[i].y - 1]++;
    } else if (P[i].direc == 3) {
      if (P[i].y - P[i].x + 1 >= 1) ans[P[i].y - P[i].x + 1]++;
    } else if (P[i].direc == 2) {
      if (P[i].x % 2 == 1) ans[P[i].y]++;
    } else if (P[i].direc == 4) {
      if (P[i].x == 1) ans[P[i].y]++;
    }
  }
  for (int i = 1; i <= m; i++) cout << ans[i] << " ";
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    s[i] = '0' + s[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (s[i][j] == 'R')
        P[++cnt] = nhen(i, j, 1);
      else if (s[i][j] == 'L')
        P[++cnt] = nhen(i, j, 3);
      else if (s[i][j] == 'U')
        P[++cnt] = nhen(i, j, 2);
      else if (s[i][j] == 'D')
        P[++cnt] = nhen(i, j, 4);
    }
  }
  solve();
  return 0;
}
