#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  bool flag = false;
  int min_count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flag = true;
    }
    if ((flag == true) && (s[i] == '.')) {
      min_count++;
    }
  }
  min_count = min(min_count, (int)count(s.begin(), s.end(), '#'));
  min_count = min(min_count, (int)count(s.begin(), s.end(), '.'));
  cout << min_count << endl;
}
