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