#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 1LL << 62;
  bool ch = true;
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (ch) {
      if (s[i] == '.') {
        continue;
      } else {
        ch = false;
      }
    } else {
      if (s[i] == '.') {
        cnt++;
      }
    }
  }
  ans = min(ans, cnt);
  cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.') {
      cnt++;
    }
  }
  ans = min(ans, cnt);
  for (long long i = 0; i < n; i++) {
    if (s[i] == '#') {
      cnt++;
    }
  }
  cout << min(ans, cnt);
  return 0;
}
