#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  char S[N];
  int BL[N], BR[N], B = 0;
  for (int i = 0; i < N; i++) {
    BL[i] = BR[i] = 0;
  }
  scanf("%s", S);
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      for (int j = i; j < N; j++) {
        BL[j]++;
      }
      for (int j = 0; j <= i; j++) {
        BR[j]++;
      }
      B++;
    }
  }
  int dp[N];
  for (int i = 0; i < N - 1; i++) {
    dp[i] = BL[i] + N - i - 1 - BR[i + 1];
  }
  dp[N - 1] = N - B;
  int ans = ((B) < (N) ? (B) : (N));
  for (int i = 0; i < N; i++) {
    ans = ((ans) < (dp[i]) ? (ans) : (dp[i]));
  }
  printf("%d", ans);
  return 0;
}
