#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, k, i, flag = 0, ans = 0, count = 0;
  cin >> n;
  string str;
  cin >> str;
  for (i = 0; i < str.length(); i++) {
    if (str[i] == '#') {
      flag = 1;
    } else {
      if (flag == 1)
        count += 1;
      else {
        ans += count;
        count = 0;
      }
    }
  }
  ans += count;
  cout << ans << endl;
  return 0;
}
