#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int slen = (int)s.size();
  int ans = 0;
  int i = slen - 1;
  while (i > 0) {
    bool flag = false;
    if (s[i] == '.' && s[i - 1] == '#') {
      i = i - 2;
      ans++;
      while (s[i] == '#') {
        if (i == 0) {
          break;
        }
        ans++;
        i--;
      }
      flag = true;
    }
    if (!flag) i--;
  }
  cout << ans << endl;
}
