#include <bits/stdc++.h>
struct Vec2 {
  int x;
  int y;
};
Vec2 operator*(const Vec2& left, int scalar) {
  Vec2 result;
  result.x = left.x * scalar;
  result.y = left.y * scalar;
  return result;
}
struct Vec2Hash {
  int M_;
  Vec2Hash(int M) : M_(M) {}
  size_t operator()(const Vec2& vec) const { return M_ * vec.y + vec.x; }
};
Vec2 operator*(int scalar, const Vec2& right) { return right * scalar; }
bool operator==(const Vec2& left, const Vec2& right) {
  return right.x == left.x && right.y == left.y;
}
Vec2 operator+(const Vec2& left, const Vec2& right) {
  Vec2 result;
  result.x = left.x + right.x;
  result.y = left.y + right.y;
  return result;
}
int spiders_met(const std::unordered_map<Vec2, Vec2, Vec2Hash>& spiders, int N,
                int j) {
  int spidersMet = 0;
  static Vec2 dirs[] = {Vec2{-1, 0}, Vec2{1, 0}, Vec2{0, -1}, Vec2{0, 1}};
  for (int i = 1; i < N; ++i) {
    Vec2 testPos = {j, i};
    for (int k = 0; k < 4; ++k) {
      Vec2 pos = testPos + dirs[k] * i;
      auto iter = spiders.find(pos);
      if (iter != spiders.end() && (iter->second * (-1) == dirs[k])) {
        ++spidersMet;
      }
    }
  }
  return spidersMet;
}
int main() {
  int N, M, spiderCount;
  std::cin >> N;
  std::cin >> M;
  std::cin >> spiderCount;
  std::unordered_map<Vec2, Vec2, Vec2Hash> spiders(spiderCount, Vec2Hash(M));
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < M; ++j) {
      char dir;
      std::cin >> dir;
      Vec2 step;
      bool hasSpider = true;
      switch (dir) {
        case 'R':
          step = {1, 0};
          break;
        case 'L':
          step = {-1, 0};
          break;
        case 'U':
          step = {0, -1};
          break;
        case 'D':
          step = {0, 1};
          break;
        default:
          hasSpider = false;
          break;
      }
      if (hasSpider) {
        Vec2 origin = {j, i};
        spiders[origin] = step;
      }
    }
  }
  for (int j = 0; j < M; ++j) {
    std::cout << spiders_met(spiders, N, j) << " ";
  }
  return 0;
}
