#include <bits/stdc++.h>
using namespace std;
int n, r = -1, mc = 0, count1 = 0, count2 = 0;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; ++i) {
    if (s.at(i) == '#') {
      mc++;
      if (s.at(i + 1) == '.') {
        r = i;
        count2 += mc;
        mc = 0;
      }
    } else {
      count1++;
    }
  }
  cout << min(count1, count2) << endl;
}
