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