#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  int ans = 0;
  int hidari = 0;
  int migi = 0;
  cin >> N >> S;
  for (int i = 0; i < (N - 1); i++) {
    if ((S.at(i) == '#') & (S.at(i + 1) == '.')) {
      hidari = 1;
      migi = 1;
      for (int j = i; j > 0; j--) {
        if (S.at(j - 1) == '#') {
          hidari++;
        } else {
          break;
        }
      }
      for (int j = i + 1; j < (N - 2); j++) {
        if (S.at(j + 1) == '.') {
          migi++;
        } else {
          break;
        }
      }
      ans = ans + min(migi, hidari);
    }
  }
  cout << ans << endl;
}
