#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9, MOD = 1e9 + 7;
const double EPS = 1e-9, PI = 3.141592653589793;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, ans = 0, tapu = 0;
  bool ok = true;
  string s;
  cin >> n >> s;
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] == '#') {
      if (s[i + 1] == '.') {
        ok = false;
        break;
      }
    }
  }
  if (ok)
    cout << 0 << "\n";
  else {
    for (long long i = 0; i < n; i++) {
      if (s[i] == '#') tapu = 1;
      if (tapu == 1 && s[i] == '.') ans++;
    }
    cout << ans << "\n";
  }
  return 0;
}
