#include <bits/stdc++.h>
using namespace std;
int start;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int counter_kuro = 0;
  int counter_shiro = 0;
  int start_kuro = 0;
  int ans = 0;
  int menjo = 0;
  for (size_t i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      counter_kuro++;
      if (start_kuro == 0) {
        start_kuro = i;
      }
    } else if (s[i] == '.')
      counter_shiro++;
  }
  if (counter_kuro > counter_shiro)
    ans = counter_shiro;
  else
    ans = counter_kuro;
  if ((s.size() - start_kuro) < ans) ans = s.size() - start_kuro;
  cout << ans << endl;
  return 0;
}
