#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll N;
string S;
void solve() {
  ll res1 = 0, res2 = 0;
  ll n = S.size();
  for (int i = 0; i < n; i++) {
    if (S[i] == '#') {
      res1++;
    }
  }
  res2 = n - res1;
  for (int i = n - 1; i >= 0; i--) {
    if (S[i] == '#') {
      res1--;
    }
    if (S[i] == '.') {
      break;
    }
  }
  cout << min(res1, res2) << "\n";
  return;
}
int main() {
  cin >> N >> S;
  solve();
  return 0;
}
