#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int ans = 0;
  bool flg = false;
  for (int i = 0; i < s.size(); i++) {
    if (flg == false && s[i] == '#')
      flg = true;
    else if (flg == true && s[i] == '.') {
      ans++;
    }
  }
  cout << ans << endl;
}
