#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  string s;
  cin >> s;
  vector<long long> vec;
  bool start = 0;
  bool swi;
  if (s.substr(0, 1) == "#") {
    swi = 0;
  } else {
    swi = 1;
    start = 1;
  }
  if (swi == 0) {
    vec.push_back(0);
  }
  long long f = 0;
  long long cont = 1;
  long long white = 0;
  for (long long i = 0; i < s.length() - 1; i++) {
    if (swi == 0) {
      if (s.substr(i, 1) == "#" && s.substr(i + 1, 1) == ".") {
        vec.push_back(cont);
        swi = 1;
        cont = 1;
      } else {
        cont++;
      }
    } else {
      if (s.substr(i, 1) == "." && s.substr(i + 1, 1) == "#") {
        vec.push_back(cont);
        white += cont;
        swi = 0;
        cont = 1;
      } else {
        cont++;
      }
    }
  }
  vec.push_back(cont);
  if (s.substr(s.length() - 1, 1) == ".") {
    white += cont;
  }
  if (cont == s.length()) {
    cout << "0" << endl;
    return 0;
  } else if (vec.size() == 2) {
    if (start == 1) {
      cout << "0" << endl;
    }
    return 0;
  }
  long long right = 0;
  long long black = 0;
  long long ans = 1145141919;
  for (int i = 0; i < vec.size(); i++) {
    int Center = i;
    if (i % 2 == 0) {
      white -= vec[i];
    } else {
      black += vec[i];
    }
    cout << black << " " << white << endl;
    ans = min(ans, black + white);
  }
  cout << ans << endl;
}
