#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  string s;
  long count1 = 0;
  long count2 = 0;
  bool wall = true;
  long bs = 0;
  cin >> n;
  cin >> s;
  for (long i = 0; i < n; i++) {
    if (s[i] == '#') {
      wall = false;
      bs++;
    }
    if (s[i] == '.') {
      count2 += bs;
      bs = 0;
      if (!(wall)) count1++;
    }
  }
  if (count1 > count2) swap(count1, count2);
  cout << count1 << endl;
  cout << count2 << endl;
  return 0;
}
