링크 : https://www.acmicpc.net/problem/2799
/*
문제 : 블라인드
링크 : https://www.acmicpc.net/problem/2799
*/
#include <iostream>
using namespace std;
int main() {
int m, n;
cin >> m >> n;
char arr[501][501];
int count[5] = {0, };
for (int i = 0; i < 5 * m + 1; i++){
for (int j = 0; j < 5 * n + 1; j++){
cin >> arr[j][i];
}
}
for ( int i = 0; i < m; i++ ) {
for ( int j = 0; j < n; j++ ) {
if( arr[5*j+1][5*i+4] == '*' ) count[4]++;
else if ( arr[5*j+1][5*i+3] == '*' ) count[3]++;
else if ( arr[5*j+1][5*i+2] == '*' ) count[2]++;
else if ( arr[5*j+1][5*i+1] == '*' ) count[1]++;
else count[0]++;
}
}
for ( int i = 0; i < 5; i++ ){
cout << count[i] << " ";
}
}