#include <bits/stdc++.h>
using namespace std;
int min_change(int N, string S) {
  int kuro = 0, shiro = 0;
  int m = N;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') shiro++;
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') kuro++;
    if (S[i] == '.') shiro--;
    m = min(m, (kuro + shiro));
  }
  return m;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  cout << min_change(N, S) << endl;
  return 0;
}
