#include <algorithm>
#include <cstdio>
const int MAXN = 2e5+5;
char S[MAXN];
int N;

bool is_white(char c) { return (c == '.'); }

int main() {
  scanf(" %d%s", &N, S);
  int cnt = std::count_if(S, S+N, is_white);
  int ret = cnt;
  for (int i = 0; i < N; ++i) {
    if (is_white(S[i])) {
      --cnt;
    } else {
      ++cnt;
    }
    ret = std::min(cnt, ret);
  }
  printf("%d\n", ret);
  return 0;
}