#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int n, ans = 0;
  string s;
  cin >> n >> s;
  int r = n - 1, l = 0;
  while (s[l] == '.' && l < n) l++;
  while (s[r] == '#' && r > 0) r--;
  if (r < l || l == n - 1 || r == 0) {
    cout << 0 << endl;
    return 0;
  }
  int wc = 0, bc = 0;
  for (int i = l; i <= r; i++) {
    if (s[i] == '.')
      wc++;
    else
      bc++;
  }
  cout << min(wc, bc) << endl;
  return 0;
}
