#include <bits/stdc++.h>
using namespace std;
long long int A[5000001];
vector<long long int> v;
vector<pair<long long int, long long int> > v2;
int main() {
  long long int n, k, white = 0, black = 0;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      for (int j = i; j < s.size(); j++) {
        if (s[j] == '.')
          white++;
        else
          black++;
      }
      break;
    }
  }
  cout << min(white, black) << endl;
  return 0;
}
