#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> v(s.size());
  int cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) == ('#')) {
      cnt++;
    }
    v.at(i) = cnt;
  }
  int ans = 1000000000;
  for (int i = 0; i < s.size(); i++) {
    int tmp = 0;
    tmp += v.at(i);
    tmp += n - (i + 1) - (v.at(n - 1) - v.at(i));
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}
