#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x;
  return is;
}
using ll = long long;
using VI = vector<int>;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int white = 0, black = 0, ans = 1000000;
  string tmp = s;
  int ans2 = 0, ans3 = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '.') white++;
  }
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#') black++;
    if (s[i] == '.') white--;
    ans = min(ans, black + white);
  }
  for (int i = n - 1; i > 0; i--) {
    if (s[i] == '.' and s[i - 1] == '#') {
      ans3++;
      s[i - 1] = '.';
    }
  }
  s = tmp;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#' and s[i + 1] == '.') {
      ans2++;
      s[i + 1] = '#';
    }
  }
  cout << min(ans, min(ans2, ans3)) << endl;
  cout << ans << endl;
  return 0;
}
