#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF * INF * 10;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int num = 0;
  bool flag = false;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      flag = true;
    }
    if (flag && s[i] == '.') {
      num++;
    }
  }
  cout << num << endl;
}
