#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18 + 1;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int a = s.size();
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      a = i;
      break;
    }
  }
  int ans;
  if (a != s.size())
    ans = count(s.cbegin() + a, s.cend(), '.');
  else
    ans = 0;
  cout << ans << endl;
  return 0;
}
