#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int firstblack, lastwhite;
  int countofdot = count(s.begin(), s.end(), '.');
  int countofhash = n - countofdot;
  if (countofhash == n or countofdot == n) return cout << 0 << '\n', 0;
  for (int i = 0; i < n; i++)
    if (s[i] == '#') {
      firstblack = i;
      break;
    }
  for (int i = n - 1; i >= 0; i--)
    if (s[i] == '.') {
      lastwhite = i;
      break;
    }
  int lans = 0, rans = 0;
  for (int i = firstblack + 1; i < n; i++) lans += (s[i] == '.');
  for (int i = lastwhite - 1; i >= 0; i--) rans += (s[i] == '#');
  cout << min(lans, rans) << endl;
}
