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