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