#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  string test = S;
  vector<int> count(N + 1, 0);
  for (int i = 0; i <= N; i++) {
    for (int j = 0; j < N; j++) {
      if (j < i)
        test[j] = '.';
      else
        test[j] = '#';
    }
    for (int j = 0; j < N; j++) {
      if (test[j] != S[j]) {
        count[i]++;
      }
    }
  }
  int min = 9999999;
  for (int i = 0; i <= N; i++) {
    if (count[i] < min) min = count[i];
  }
  cout << min << endl;
}
