#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int max = 0;
  int ans = 999999;
  for (int i = 0; i <= N; i++) {
    for (int j = i; j <= N; j++) {
      if (S[j] == '.') {
        S[j] == '#';
        max++;
      }
    }
    for (int j = i; j >= 1; j--) {
      if (S[j] == '#') {
        S[j] == '.';
        max++;
      }
    }
    if (max < ans) {
      ans = max;
    }
    max = 0;
  }
  cout << ans;
}
