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