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