#include <bits/stdc++.h>
using namespace std;
void solve() {
  int ans = 0;
  int n;
  cin >> n;
  string s;
  cin >> s;
  int flg = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flg = 1;
    }
    if (flg == 1 && s[i] == '.') ans++;
  }
  int tmp = 0;
  flg = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      flg = 1;
    }
    if (flg == 1 && s[i] == '#') tmp++;
  }
  cout << min(ans, tmp) << endl;
}
int main() {
  solve();
  return 0;
}
