#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, countw = 0, counti = 0, t1 = 0, t2 = 0, count = 0;
  string S;
  cin >> N >> S;
  t1 = N + 1;
  t2 = N + 1;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      for (int j = i; j < N; j++) {
        if (S.at(j) == '.') {
          countw++;
        }
      }
      counti++;
      if (t1 > t2) {
        t1 = countw + counti - 1;
      } else {
        t2 = countw + counti - 1;
      }
    }
  }
  if (S.at(0) == '.') {
    if (S.at(N - 1) == '.') {
      for (int j = 0; j < N; j++) {
        if (S.at(j) == '.') {
          count++;
        }
      }
    }
  }
  if (count == N) {
    t1 = 0;
  }
  if (t1 > t2) {
    cout << t2 << endl;
  } else {
    cout << t1 << endl;
  }
}
