#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ind;
  int numB = 0, ans = 999999999;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#') {
      int numW = 0;
      for (int j = i; j < N; j++) {
        if (S[j] == '.') {
          numW++;
        }
      }
      ans = min(numW + numB, ans);
      numB++;
    }
  }
  ans = min(numB, ans);
  cout << ans << endl;
  return 0;
}
