#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> vec(n);
  int count = 0;
  int recount = 0;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      if (s.at(j) == '#') {
        count += 1;
      }
    }
    for (int j = i; j < n; j++) {
      if (s.at(j) == '.') {
        recount += 1;
      }
    }
    vec[i] = count + recount;
    count = 0;
    recount = 0;
  }
  if (s.at(n - 1) == '.') vec[n - 1] -= 1;
  sort(vec.begin(), vec.end());
  cout << vec[0] << endl;
}
