#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
const ll mod = 1e9 + 7;
int main() {
  ll n, w = 0, b = 0, x = 0, y = 0;
  cin >> n;
  string s;
  cin >> s;
  for (ll i = ll(s.length() - 1); i >= ll(0); i--)
    if (s[i] == '#') {
      x = i;
    }
  for (ll i = ll(s.length()); i >= ll(x); i--)
    if (s[i] == '.') w++;
  for (ll i = ll(0); i < ll(s.length()); i++)
    if (s[i] == '.') {
      x = i;
    }
  for (ll i = ll(0); i < ll(x + 1); i++)
    if (s[i] == '#') b++;
  cout << min(w, b);
}
