#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int ans = 0;
  int flag = 0, count = 0;
  for (int i = 0; i < N; i++) {
    if (s[i] == '#') {
      count++;
    }
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      flag = 1;
    }
    if (flag > 0) {
      if (s[i] == '.') {
        ans++;
      }
    }
  }
  cout << min(count, ans) << endl;
}
