#include <bits/stdc++.h>
using namespace std;
int n, m, k, v[2005];
char a[2005][2005];
void Citire() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) cin >> (a[i] + 1);
}
void Rez() {
  int t, solutie = 0;
  for (int j = 1; j <= m; j++) {
    for (int i = 1; i <= n; i++) {
      t = i - 1;
      if (i - t >= 1 && a[i - t][j] == 'D') solutie++;
      if (i + t <= n && a[i + t][j] == 'U') solutie++;
      if (j - t >= 1 && a[i][j - t] == 'R') solutie++;
      if (j + t <= m && a[i][j + t] == 'L') solutie++;
    }
    v[j] = solutie;
    solutie = 0;
  }
  for (int i = 1; i <= m; i++) cout << v[i] << " ";
  cout << "\n";
}
int main() {
  Citire();
  Rez();
  return 0;
}
