#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int res[N];
int n, m, k;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  char x = getchar();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      x = getchar();
      switch (x) {
        case 'D': {
          if (i == 1) res[j]++;
          break;
        }
        case 'U': {
          if ((i - 1) % 2 == 0) res[j]++;
          break;
        }
        case 'R': {
          if (j + i - 1 <= m) res[j + i - 1]++;
          break;
        }
        case 'L': {
          if (j - i + 1 >= 1) res[j - i + 1]++;
          break;
        }
        default: {
        }
      }
    }
    x = getchar();
  }
  for (int i = 1; i <= m; i++) cout << res[i] << " ";
}
