#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> bc;
  bc.push_back(s[0] == '#');
  for (int i = 1; i < s.length(); i++) {
    int t = bc[i - 1];
    if (s[i] == '#') {
      bc.push_back(t + 1);
    } else {
      bc.push_back(t);
    }
  }
  int mi = bc[n - 1];
  for (int i = 1; i <= s.length(); i++) {
    int t = bc[i - 1] + (n - i) - (bc[n - 1] - bc[i - 1]);
    if (t < mi) mi = t;
  }
  cout << mi << endl;
}
