#include <bits/stdc++.h>
using namespace std;
int inputValue() {
  int a;
  cin >> a;
  return a;
};
void inputArray(int* p, int a) {
  for (int i = (0); i < (a); i++) {
    cin >> p[i];
  }
};
void inputVector(vector<int>* p, int a) {
  for (int i = (0); i < (a); i++) {
    int input;
    cin >> input;
    p->push_back(input);
  }
}
template <typename T>
void output(T a, int precision) {
  if (precision > 0) {
    cout << setprecision(precision) << a << "\n";
  } else {
    cout << a << "\n";
  }
}
int main(int argc, const char* argv[]) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int minCount = 100000000;
  for (int i = 0; i < N; i++) {
    int whiteCount = 0;
    int blackCount = 0;
    for (int j = i; j < N; j++) {
      string target = S.substr(j, 1);
      if (target == ".") {
        whiteCount++;
      }
    }
    if (i == 0) {
      if (whiteCount < minCount) {
        minCount = whiteCount;
        continue;
      }
    }
    for (int j = 0; j < i; j++) {
      string target = S.substr(j, 1);
      if (target == "#") {
        blackCount++;
      }
    }
    if (whiteCount + blackCount < minCount) {
      minCount = whiteCount + blackCount;
      continue;
    }
  }
  cout << minCount << endl;
  return 0;
}
