#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const int mx = 100010;
const long long mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  int tmp = 0;
  bool flag = false;
  for (int i = (int)(0); i < (int)(n); ++i) {
    if (flag && s[i] == '.') {
      ans++;
    }
    if (s[i] == '#') {
      flag = true;
      tmp++;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#') {
      tmp--;
    } else {
      break;
    }
  }
  cout << min(ans, tmp) << endl;
  return 0;
}
