#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  long long b = 0, w = 0;
  long long B[200000], W[200000];
  S = '.' + S + '#';
  for (int i = 0; i < N + 2; i++) {
    B[i] = b;
    if (S[i] == '#') b++;
  }
  for (int i = N + 1; i >= 0; i--) {
    W[i] = w;
    if (S[i] == '.') w++;
  }
  int ans = 400000;
  for (int i = 0; i <= N + 1; i++) {
    int g = B[i] + W[i];
    ans = min(ans, g);
  }
  cout << ans << '\n';
}
