#include <bits/stdc++.h>
using namespace std;
using llong = long long;
const int MOD = 1000000007;
int main(int argc, char** argv) {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int ans = 0;
  int do_count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') do_count = 1;
    if (do_count) {
      if (s[i] == '.') {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
