#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  string s;
  cin >> s;
  while (s.back() == '#') s.pop_back();
  while (s.front() == '.') s.erase(s.begin());
  ll b, w;
  b = w = 0;
  for (ll i = 0; i < s.size(); ++i) {
    if (s[i] == '#')
      b++;
    else
      w++;
  }
  cout << min(b, w);
}
