#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool a = false;
  long long ans = 0;
  for (int i = 0; i < s.length(); i++) {
    if (a == false && s.at(i) == '#') a = true;
    if (a == true && s.at(i) == '.') ans++;
  }
  cout << ans << endl;
}
