#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void YES() { cout << "YES" << endl; }
void NO() { cout << "NO" << endl; }
int main() {
  ll n;
  string s;
  cin >> n >> s;
  bool found_b = false;
  ll cnt1 = 0;
  for (ll i = 0; i < n; i++) {
    if (s[i] == '#') found_b = true;
    if (found_b && s[i] == '.') cnt1++;
  }
  bool found_w = false;
  ll cnt2 = 0;
  for (ll i = n - 1; i >= 0; i--) {
    if (s[i] == '.') found_w = true;
    if (found_w && s[i] == '#') cnt2++;
  }
  cout << min(cnt1, cnt2) << endl;
}
