#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> C(N, 0);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (j <= i) {
        if (S[j] == '#') {
          C[i]++;
        }
      } else {
        if (S[j] == '.') {
          C[i]++;
        }
      }
    }
  }
  sort(C.begin(), C.end());
  cout << C[0] << endl;
}
