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