#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int cnt = 0;
  bool f = 0;
  for (int i = 0; i < N; i++) {
    char ch = S[i];
    if (ch == '#') f = 1;
    if (f) {
      if (ch == '.') cnt++;
    }
  }
  cout << cnt << endl;
}
