#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      for (int j = i + 1; j < n; ++j) {
        if (s[j] == '.') ++ans;
      }
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
