#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool exist = false;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      exist = true;
    else if (s[i] == '.') {
      if (exist) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
