#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
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;
}
const long long INF = 1e18;
const long long mod = 1e9 + 7;
const double eps = 0.000000001;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0;
  bool ok = false;
  for (long long i = 0; i < (n); i++) {
    if (s[i] == '#') ok = true;
    if (ok && s[i] == '.') ans++;
  }
  cout << ans << endl;
  return 0;
}
