#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = INT_MAX;
  for (int i = 0; i < N; ++i) {
    int changeCount = 0;
    bool allWhite = true;
    for (int j = 0; j < N; ++j) {
      if (S[j] == '.') {
        if (j >= i) ++changeCount;
      }
      if (S[j] == '#') {
        allWhite = false;
        if (j < i) ++changeCount;
      }
    }
    if (allWhite) ans = 0;
    ans = min(ans, changeCount);
  }
  cout << ans << endl;
  return 0;
}
