#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> blacks;
  int cnt = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '#') cnt++;
    blacks.push_back(cnt);
  }
  int ans = 300000;
  int tmp;
  tmp = (int)s.length() - (blacks[s.length() - 1]);
  if (tmp < ans) ans = tmp;
  for (int j = 1; j < s.length(); j++) {
    tmp = (int)s.length() - j - (blacks[s.length() - 1] - blacks[j]) +
          blacks[j - 1];
    if (tmp < ans) ans = tmp;
  }
  cout << ans << endl;
}
