#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18 + 1;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int a = s.size(), b = s.size();
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      if (a == s.size()) a = i;
    }
    if (s[i] == '.') b = i;
  }
  int r = (int)count(s.cbegin() + a, s.cend(), '.');
  int l = (int)count(s.cbegin(), s.cbegin() + b, '#');
  cout << min(l, r) << endl;
  return 0;
}
