#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, a = 0, b = 0, kuro = 0, siro = 0, Ans = 200000, sub;
  string S;
  cin >> N >> S;
  for (i = 0; i < N; i++) {
    if (S[i] == '.') siro += 1;
    if (S[i] == '#') kuro += 1;
  }
  for (i = 0; i < N; i++) {
    sub = b + siro - a;
    if (Ans > sub) Ans = sub;
    while (S[i] == '.') {
      a += 1;
      i += 1;
    }
    while (S[i] == '#') {
      b += 1;
      i += 1;
    }
    sub = b + siro - a;
    if (Ans > sub) Ans = sub;
  }
  cout << Ans;
  return 0;
}
