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