#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 233;
int n, m;
int a[maxn];
int main() {
  cin >> n;
  string s;
  cin >> s;
  int f = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') f = 1;
    if (f && s[i] == '.') ans++;
  }
  cout << ans << endl;
  return 0;
}
