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