#include <bits/stdc++.h>
using namespace std;
using llong = long long;
const int MOD = 1000000007;
int main(int argc, char** argv) {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int tmp1 = 0;
  int do_count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      do_count = 1;
      continue;
    }
    if (do_count) {
      if (s[i] == '.') {
        tmp1++;
      }
    }
  }
  int tmp2 = 0;
  do_count = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      do_count = 1;
      continue;
    }
    if (do_count) {
      if (s[i] == '#') {
        tmp2++;
      }
    }
  }
  int ans = min(tmp1, tmp2);
  cout << ans << endl;
  return 0;
}
