#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll to_black_all(string s, ll start, ll ret) {
  start++;
  while (1) {
    start = s.find('.', start);
    if ((int)start == -1) {
      break;
    }
    ret++;
    start++;
  }
  return ret;
}
ll to_white_black(string s) {
  ll ret = 0;
  ll start = 0;
  ll wr = s.rfind('.');
  while (1) {
    start = s.find('#', start);
    if (((int)start == -1 || start > wr)) {
      break;
    }
    ret++;
    start++;
  }
  return ret;
}
int main(void) {
  ll n;
  string s;
  cin >> n >> s;
  ll b, w, wb;
  wb = to_white_black(s);
  b = to_black_all(s, s.rfind('.'), wb);
  w = n - b;
  cout << b << endl;
  cout << w << endl;
  cout << wb << endl;
  cout << min({b, w, wb}) << endl;
  return 0;
}
