#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, w = 0, b = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') w++;
  }
  int ans = N;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '.') w--;
    if (S[i] == '#') b++;
    if (S[i] != S[i + 1] && ans > w + b) ans = w + b;
  }
  if (ans == N) ans = 0;
  printf("%d\n", ans);
}
