#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int kuro_count(string s, int n, int N) {
  int kuro = 0;
  for (int i = 0; i <= n; i++) {
    if (s.at(i) == '#') {
      kuro++;
    }
  }
  return kuro;
}
int siro_count(string s, int n, int N) {
  int siro = 0;
  for (int i = n + 1; i < N; i++) {
    if (s.at(i) == '.') {
      siro++;
    }
  }
  return siro;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> kouho(N + 1);
  for (int i = -1; i < N; i++) {
    int sum = 0;
    if (i == -1) {
      sum = siro_count(S, i, N);
      kouho.at(0) = sum;
    }
    if (i == N - 1) {
      sum = kuro_count(S, i - 1, N);
      kouho.at(N) = sum;
    } else {
      sum = kuro_count(S, i, N) + siro_count(S, i, N);
      kouho.at(i + 1) = sum;
    }
  }
  sort(kouho.begin(), kouho.end());
  cout << kouho.at(0) << endl;
}
