#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count = 0;
  int firstindex = 0;
  int endindex = n - 1;
  for (int i = 0; i < n; i++) {
    if (s[i] == ('#')) break;
    firstindex++;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == ('.')) break;
    endindex--;
  }
  for (int i = firstindex; i <= endindex; i++)
    if (s[i] == ('#')) count++;
  cout << min(count, (endindex - firstindex + 1) - count) << endl;
  return 0;
}
