#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, X, Y;
  int a = 0;
  int b = 0;
  int c = 0;
  int d = 0;
  string S;
  cin >> N >> S;
  int n = N - 1;
  for (int i = 0; i < N; i++) {
    if (S[n - i] == '.') {
      for (int j = 0; j <= n - i; j++) {
        if (S[j] == '.')
          a++;
        else
          b++;
      }
      break;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') c++;
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') d++;
  }
  X = min(a, b);
  Y = min(c, d);
  cout << min(X, Y) << endl;
  return 0;
}
