#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int tmp = 0;
  vector<int> box;
  for (int i = 0; i < N; i++) {
    tmp = 0;
    for (int j = 0; j <= i; j++) {
      if (S[j] != '.') {
        tmp++;
      }
    }
    for (int j = i + 1; j < N; j++) {
      if (S[j] != '#') {
        tmp++;
      }
    }
    box.push_back(tmp);
  }
  cout << *min_element(box.begin(), box.end()) << '\n';
  return 0;
}
