#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long res[2009];
char c;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (long long i = (1); i < (n + 1); i++)
    for (long long j = (1); j < (m + 1); j++) {
      cin >> c;
      if (c == 'U' && (i - 1) % 2 == 0) res[j]++;
      if (c == 'D' && i == 1) res[j]++;
      if (c == 'R' && i + j - 1 <= m) res[i + j - 1]++;
      if (c == 'L' && j - i + 1 >= 1) res[j - i + 1]++;
    }
  for (long long i = (1); i < (m + 1); i++) cout << res[i] << " ";
  return 0;
}
