#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int count = 0;
  int count_w = 0;
  int point = 0;
  string S_w = S;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      for (int j = N - 1; i < j; j--) {
        if (S.at(j) == '.') {
          S.at(j) = '#';
          count++;
        }
      }
    }
  }
  for (int i = 0; i < N; i++) {
    if (S_w.at(i) == '#') {
      S_w.at(i) = '.';
      count_w++;
    }
  }
  cout << min(count, count_w) << endl;
}
