#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  bool black = false;
  for (int i = 0; i < n; i++) {
    if (s.substr(i, 1) == "." && black == true)
      ans += 1;
    else if (s.substr(i, 1) == "#")
      black = true;
  }
  cout << ans << endl;
}
