#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int res1 = 0;
  bool black = false;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '#')
      black = true;
    else if (black == true)
      res1++;
  }
  int res2 = 0;
  bool white = false;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.')
      white = true;
    else if (white == true)
      res2++;
  }
  cout << min(res1, res2) << endl;
}
