#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  int shiro;
  int tmp = (int)1e9;
  int a = 0;
  int l = 0;
  while (l < N) {
    while (l < N && S[l] == '.') ++l;
    if (l == N) {
      cout << min(tmp, a) << endl;
      return 0;
    }
    shiro = 0;
    for (int i = l; i < N; ++i) {
      if (S[i] == '.') {
        ++shiro;
      }
    }
    tmp = min(tmp, shiro + a);
    ++a;
    ++l;
  }
  cout << min(tmp, a) << endl;
}
