#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, o = 0, ans1 = 0, ans2 = 0;
  string s, t, u;
  cin >> n >> s;
  for (ll i = 0; i < n; i++) {
    if (o == 1 && s[i] == '.') {
      ans1++;
    } else if (o == 0 && s[i] == '#') {
      o = 1;
    }
  }
  o = 0;
  for (ll i = n - 1; i >= 0; i--) {
    if (o == 1 && s[i] == '#') {
      ans2++;
    } else if (o == 0 && s[i] == '.') {
      o = 1;
    }
  }
  cout << min(ans1, ans2) << endl;
}
