#include <bits/stdc++.h>
int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a = a % b;
    swap(a, b);
  }
  return a;
}
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  n = s.size();
  int bcnt = 0;
  bool founddot = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      founddot = true;
    }
    if (founddot && s[i] == '.') {
      bcnt++;
    }
  }
  int dcnt = 0;
  bool foundhash = false;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      foundhash = true;
    }
    if (foundhash && s[i] == '#') {
      dcnt++;
    }
  }
  cout << min(dcnt, bcnt) << endl;
  return 0;
}
