#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  int anss = 0;
  int f = 0;
  int a[2];
  for (int i = 0; i < 2; i++) {
    a[i] = 0;
  }
  int j = 0;
  int jj = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '#') {
      j = 1;
    }
    if (j == 0) {
      jj++;
    }
    if (s.at(i) == '.') {
      a[0]++;
    } else {
      a[1]++;
    }
  }
  int g = 0;
  int gg = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s.at(i) == '.') {
      g = 1;
    }
    if (g == 0) {
      gg++;
    }
  }
  cout << min(a[0] - jj, a[1] - gg) << endl;
}
