#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const ll LINF = 1e18;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N;
  cin >> S;
  int len = S.length();
  int ans = INF;
  int cntAllD = 0;
  int cntAllH = 0;
  for (int i = (0); i < (len); ++i) {
    if (S[i] == '.')
      ++cntAllD;
    else
      ++cntAllH;
  }
  bool flag = false;
  if (cntAllD == 0 or cntAllH == 0) flag = true;
  if (!flag) {
    char lastS;
    int cntD = 0;
    int cntH = 0;
    for (int i = (0); i < (len); ++i) {
      if (i == 0) {
      } else {
        if (lastS == '.' and S[i] == '#') {
          ans = min(ans, min(cntD, cntH) + min(cntAllD - cntD, cntAllH - cntH));
        }
      }
      if (S[i] == '.')
        ++cntD;
      else if (S[i] == '#')
        ++cntH;
      lastS = S[i];
    }
  }
  if (flag)
    cout << "0" << endl;
  else
    cout << ans << endl;
  return 0;
}
