#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;
  for (int i = 0; i < N; i++) {
    leftb = 0;
    rightw = 0;
    for (int j = 0; j < i; j++) {
      if (S.at(j) == '#') {
        leftb++;
      }
    }
    for (int k = i; k < N; k++) {
      if (S.at(k) == '.') {
        rightw++;
      }
    }
    minc = min(minc, leftb + rightw);
  }
  cout << minc << endl;
  return 0;
}
