#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
using P = pair<int, int>;
using ll = long long;
const ll INF = 1LL << 60;
const int MOD = 1e9 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  set<char> color;
  map<char, int> mp;
  bool flg = false;
  bool mixed = false;
  if (s[0] == '.') {
    for (int i = 0; i < s.size(); i++) {
      color.insert(s[i]);
      mp[s[i]]++;
      if (s[i] == '#')
        flg = true;
      else if (flg)
        mixed = true;
    }
  } else {
    for (int i = 0; i < s.size(); i++) {
      color.insert(s[i]);
      mp[s[i]]++;
      if (s[i] == '.')
        flg = true;
      else if (flg)
        mixed = true;
    }
  }
  if (color.size() == 1 || !mixed && s[0] == '.') {
    cout << 0 << endl;
    return 0;
  }
  cout << min(mp['.'], mp['#']) << endl;
  return 0;
}
