#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int inf = 1e9;
const long long mod = 1e9 + 7;
const int maxn = 2e5 + 10;
int n;
char s[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  cin >> s + 1;
  int c1 = 0, c2 = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '#') {
      for (int j = i + 1; j <= n; j++) {
        if (s[j] == '.') c1++;
      }
      break;
    }
  }
  for (int i = n; i >= 1; i--) {
    if (s[i] = '.') {
      for (int j = i - 1; j >= 1; j--) {
        if (s[j] == '#') c2++;
      }
      break;
    }
  }
  cout << min(c1, c2) << endl;
  return 0;
}
