#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> list(N);
  int count2 = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      count2 = count2 + 1;
    } else {
    }
  }
  list.at(0) = count2;
  for (int i = 1; i < N - 1; i++) {
    int count = 0;
    for (int j = 0; j < i; j++) {
      if (S.at(j) == '#') {
        count = count + 1;
      } else {
      }
    }
    for (int j = i; j < N; j++) {
      if (S.at(i) == '.') {
        count = count + 1;
      } else {
      }
    }
    list.at(i) = count;
  }
  sort(list.begin(), list.end());
  cout << list.at(0) << endl;
}
