#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int allB = 0, allW = 0, panda = 0;
  int left = 0, right = 0, minPanda = 0;
  int point = 1;
  if (S[0] == '.') {
    allB++;
  } else {
    left++;
    allW++;
  }
  for (int i = 1; i < N; i++) {
    if (S[i] == '.') {
      right++;
      allB++;
    } else {
      allW++;
    }
  }
  minPanda = left + right;
  for (int i = 2; i < N; i++) {
    if (S[i - 1] == '#') left++;
    if (S[i] == '.') right++;
    panda = left + right;
    if (panda < minPanda) minPanda = panda;
  }
  cout << min({allB, allW, minPanda}) << endl;
  return 0;
}
