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