#include <bits/stdc++.h>
using namespace std;
char board[2222][2222];
int main(void) {
  int n = 0;
  int m = 0;
  int k = 0;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < n; i++) scanf("%s", board[i]);
  for (int c = 0; c < m; c++) {
    int spider = 0;
    for (int i = 1; i < n; i++) {
      spider += (((i + i) >= 0 && (i + i) < n && (c) >= 0 && (c) < m)
                     ? board[i + i][c]
                     : '.') == 'U';
      spider += (((i - i) >= 0 && (i - i) < n && (c) >= 0 && (c) < m)
                     ? board[i - i][c]
                     : '.') == 'D';
      spider += (((i) >= 0 && (i) < n && (c - i) >= 0 && (c - i) < m)
                     ? board[i][c - i]
                     : '.') == 'R';
      spider += (((i) >= 0 && (i) < n && (c + i) >= 0 && (c + i) < m)
                     ? board[i][c + i]
                     : '.') == 'L';
    }
    printf("%d%c", spider, c == m - 1 ? '\n' : ' ');
  }
  while (getchar() != EOF)
    ;
  return 0;
}
