#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int minCount = INT32_MAX;
  for (int i = 0; i < N - 1; i++) {
    if (!(S[i] == '#' && S[i + 1] == '.')) {
      continue;
    }
    int whiteCount = 0;
    for (int j = 0; j < i; j++) {
      if (S[j] == '#') {
        whiteCount++;
      }
    }
    int blackCount = 0;
    for (int j = i; j < N; j++) {
      if (S[j] == '.') {
        blackCount++;
      }
    }
    minCount = min(minCount, (whiteCount + blackCount));
  }
  if (minCount == INT32_MAX) {
    minCount = 0;
  }
  cout << minCount << endl;
  return 0;
}
