#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll amari = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int b = 0;
  int w = 0;
  for (int i = n; i >= 0; i--) {
    if (s[i] != '#') n = i;
  }
  int k = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != '.') k = i;
  }
  for (int i = k; i <= n; i++) {
    if (s[i] == '.')
      w++;
    else
      b++;
  }
  cout << min(b, w) << endl;
  return 0;
}
