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