#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int to, weight;
};
int main() {
  int n;
  string s;
  cin >> n >> s;
  int minimum = 500000;
  int count = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == '#') ++count;
  int count2 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      ++count2;
      minimum = min(minimum, n - i - count2 + count);
    }
  }
  minimum = min(minimum, count);
  cout << minimum << endl;
}
