#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int allWhiteCount = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      allWhiteCount++;
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '#') {
      allWhiteCount--;
    } else {
      break;
    }
  }
  int blackCount = 0;
  bool flag = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      flag = true;
    } else {
      if (flag) {
        if (S[i] == '.') {
          blackCount++;
        }
      }
    }
  }
  cout << min(allWhiteCount, blackCount) << endl;
  return 0;
}
