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