#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum_black = 0, sum, sum_white = 0, minv = 200005;
  int j;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; ++i) {
    sum_black = 0;
    if (s[i] != '.') sum_white++;
    for (int j = i + 1; j < n; ++j) {
      if (s[j] != '#') ++sum_black;
    }
    sum = sum_black + sum_white;
    minv = min(sum, minv);
  }
  cout << minv << endl;
  return 0;
}
