#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int ans1 = 0;
  int ans2 = 0;
  bool flg = false;
  for (int i = 0; i < s.size(); i++) {
    if (flg == false && s[i] == '#') {
      flg = true;
    } else if (flg == true && s[i] == '.') {
      ans1++;
    }
  }
  flg = false;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (flg == false && s[i] == '.') {
      flg = true;
    } else if (flg == true && s[i] == '#') {
      ans2++;
    }
  }
  cout << min(ans1, ans2) << endl;
}
