#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> whitinng(n + 1);
  vector<int> blacking(n + 1);
  whitinng[0] = 0;
  for (int i = 1; i < s.size() + 1; i++) {
    whitinng[i] = whitinng[i - 1];
    if (s[i] == '#') whitinng[i]++;
  }
  blacking[n] = 0;
  for (int i = n - 1; i < s.size(); i--) {
    blacking[i] = blacking[i + 1];
    if (s[i] == '.') blacking[i]++;
  }
  if (whitinng[n] == 0 || blacking[0] == 0) {
    cout << 0 << endl;
    return 0;
  }
  int ans = s.size();
  for (int i = 0; i < whitinng.size(); i++) {
    ans = min(ans, whitinng[i] + blacking[i]);
  }
  cout << ans << endl;
  return 0;
}
