#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool flag = false;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flag = true;
    }
    if (flag && s[i] == '.') {
      count++;
    }
  }
  int count2 = 0;
  bool flag2 = false;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      flag2 = true;
    }
    if (flag2 && s[i] == '#') {
      count2++;
    }
  }
  int ans = min(count, count2);
  cout << ans << endl;
}
