#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int start = -1;
  int end = -1;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '#') {
      start = i;
      break;
    }
  }
  for (int i = 0; i <= S.size(); i++) {
    if (S[S.size() - i] == '#') {
      end = S.size() - i;
      break;
    }
  }
  int count = 0;
  for (int i = start; i < end; i++) {
    if (S[i] == '.') {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
