#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int allSharpCounter = 0;
  for (int i = 0; i < N; ++i) {
    if (S.substr(i, 1) == ".") {
      ++allSharpCounter;
    }
  }
  if (allSharpCounter > 0 && S.substr(0, 1) == ".") {
    --allSharpCounter;
  }
  int allDotCounter = 0;
  for (int i = 0; i < N; ++i) {
    if (S.substr(i, 1) == "#") {
      ++allDotCounter;
    }
  }
  if (allDotCounter > 0 && S.substr(N - 1, 1) == "#") {
    --allDotCounter;
  }
  int dotCounter = 0;
  for (int i = 0; i < N - 1; ++i) {
    if (S.substr(i, 1) == "#" && S.substr(i + 1, 1) == ".") {
      ++dotCounter;
      S.replace(i + 1, 1, ".");
    }
  }
  int num = min(allSharpCounter, allDotCounter);
  num = min(num, dotCounter);
  cout << num << endl;
  return 0;
}
