#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  string s;
  cin >> n >> s;
  int ans = 1000000, f = 0, cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (f == 0 && s.at(i) == '#') {
      f = 1;
    } else if (f == 1 && s.at(i) == '.') {
      ++cnt;
    }
  }
  ans = min(ans, cnt);
  f = 0, cnt = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (f == 0 && s.at(i) == '.') {
      f = 1;
    } else if (f == 1 && s.at(i) == '#') {
      ++cnt;
    }
  }
  ans = min(ans, cnt);
  cout << ans << endl;
  return 0;
}
