#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  long long num = 0;
  bool f = false;
  string s;
  cin >> N;
  cin >> s;
  while (1) {
    f = false;
    for (long long i = 0; i < N - 1; i++) {
      if (i == N - 1) i = 0;
      if (s[i] == '#' & s[i + 1] == '.') {
        num++;
        s[i] = '.';
        f = true;
      }
    }
    if (!f) break;
  }
  cout << num << endl;
}
