#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a = 0, b = 0, c = 0, j = 0;
  string S, T = "#";
  char s;
  cin >> N >> S;
  while (a == 0) {
    if (S.at(j) == '#') {
      a = 1;
    } else {
      j++;
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S.at(i) == '.') {
      b = i;
      i = -1;
    }
  }
  if (b == 0 || j == b) {
    cout << 0 << endl;
  } else {
    for (int i = 0; i < b - j; i++) {
      T += '#';
    }
    vector<int> e(b - j + 2);
    for (int i = 0; i < b - j + 1; i++) {
      if (S.at(j + i) != T.at(i)) {
        c++;
      }
      e.at(0) = c;
    }
    c = 0;
    for (int i = 0; i < 1 + b - j; i++) {
      T.at(i) = '.';
      for (int k = 0; k < 1 + b - j; k++) {
        if (S.at(j + k) != T.at(k)) {
          c++;
        }
      }
      e.at(i + 1) = c;
      c = 0;
    }
    sort(e.begin(), e.end());
    cout << e.at(0) << endl;
  }
}
