#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using LP = pair<ll, int>;
const ll MOD = 1000000007, MOD2 = 998244353;
int main() {
  int N;
  string S;
  cin >> N >> S;
  bool judge = false;
  int ans = 0;
  for (int i = 0; i < (N); i++) {
    if (S.at(i) == '#') judge = true;
    if (judge && S.at(i) == '.') ans++;
  }
  cout << ans << endl;
}
