#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, cnt = 0, cnt2 = 0;
  string s;
  cin >> n >> s;
  bool find = false;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '#') {
      find = true;
    }
    if (find && s[i] == '.') {
      cnt++;
    }
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '#') {
      cnt2++;
    }
  }
  cout << min(cnt, cnt2) << endl;
  return 0;
}
