#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
int main() {
  ll n;
  cin >> n;
  string s;
  cin >> s;
  bool f = false;
  ll a = 0, b = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') f = true;
    if (f && s[i] == '.') a++;
  }
  f = false;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') f = true;
    if (f && s[i] == '#') b++;
  }
  cout << min(a, b) << "\n";
  return 0;
}
