#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  string K = "#";
  string T = ".";
  cin >> N >> S;
  int need = 0, scount = 0, tcount = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == K[0]) {
      if (S[i + 1] == T[0]) {
        for (int j = i; j >= 0; j--) {
          if (S[j] == K[0]) {
            scount++;
          } else {
            break;
          }
        }
        for (int t = i + 1; t < N; t++) {
          if (S[t] == T[0]) {
            tcount++;
          } else {
            break;
          }
        }
        if (scount <= tcount) {
          for (int j = i; j > i - scount; j--) {
            S.replace(j, 1, ".");
          }
          need += scount;
        } else {
          for (int j = i; j > i + tcount; j++) {
            S.replace(j, 1, "#");
          }
          need += tcount;
        }
        scount = 0;
        tcount = 0;
      }
    }
  }
  cout << need << endl;
  return 0;
}
