#include #include using namespace std; void main() { string str; int x, y; int i, j; int momo, kaki; while(1){ cin >> x >> y; if( !x ) break; momo = kaki = 0; for( i = 0; i < y; i++){ cin >> str; for( j = 0; j < x; j++){ if( '*' == str[j] ) kaki++; else if( '+' == str[j] ) momo++; } } cout << momo << " " << kaki << endl; } }