#include <bits/stdc++.h>
using namespace std;
char start[2048][2048];
string str;
int R, C, K;
inline bool check(int x, int y) {
  if (x < 0 || x >= C) return false;
  if (y < 0 || y >= R) return false;
  return true;
}
int solve(int col, int row, int turn) {
  if (row >= R) return 0;
  int res = 0;
  int x, y;
  x = col;
  y = row - turn;
  if (check(x, y) && start[y][x] == 'D') res++;
  x = col;
  y = row + turn;
  if (check(x, y) && start[y][x] == 'U') res++;
  x = col - turn;
  y = row;
  if (check(x, y) && start[y][x] == 'R') res++;
  x = col + turn;
  y = row;
  if (check(x, y) && start[y][x] == 'L') res++;
  return res + solve(col, row + 1, turn + 1);
}
int main() {
  cin >> R >> C >> K;
  for (int i = 0; i < R; i++) {
    cin >> str;
    for (int j = 0; j < C; j++) start[i][j] = str[j];
  }
  for (int i = 0; i < C - 1; i++) cout << solve(i, 0, 0) << " ";
  cout << solve(C - 1, 0, 0) << endl;
  return 0;
}
