#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 1000000;
  int sum;
  for (int i = 0; i < N - 1; i++) {
    int black = 0;
    int white = 0;
    for (int j = 0; j <= i; j++) {
      if (S[j] == '#') {
        black++;
      }
    }
    for (int k = i + 1; k < N; k++) {
      if (S[k] == '.') {
        white++;
      }
    }
    sum = black + white;
    ans = min(ans, sum);
  }
  cout << ans << endl;
  return 0;
}
