#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  char splus[n + 1];
  splus[0] = 0;
  for (int i = 1; i < n + 1; i++) {
    if (s[i] == '#')
      splus[i] = splus[i - 1] + 1;
    else
      splus[i] = splus[i - 1];
  }
  int ans = n - splus[n];
  int ans_cand;
  for (int i = 1; i < n + 1; i++) {
    ans_cand = splus[i] + (n - i - splus[n] + splus[i]);
    if (ans_cand < ans) ans = ans_cand;
  }
  cout << ans_cand << endl;
}
