#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int leftb = 0;
  int rightw = 0;
  int minc = 200000;
  int cntw = 0;
  int cntb = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      cntw++;
    } else
      cntb++;
  }
  int flag = 0;
  for (int i = 0; i < N; i++) {
    leftb = 0;
    rightw = 0;
    for (int j = 0; j < i; j++) {
      if (S.at(j) == '#') {
        leftb++;
        if (leftb > cntw || leftb > cntb) {
          flag = 1;
          break;
        }
      }
    }
    for (int k = i; k < N; k++) {
      if (S.at(k) == '.') {
        rightw++;
        if (rightw > cntw || rightw > cntb) {
          flag = 1;
          break;
        }
      }
    }
    minc = min(minc, leftb + rightw);
  }
  cout << min(min(minc, cntb), cntw) << endl;
  return 0;
}
