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