#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int ans = 2000000;
  for (int i = 0; i < N + 1; i++) {
    int leftB = 0;
    int rightW = 0;
    for (int j = 0; j < i; j++) {
      if (S.at(j) == '#') {
        leftB++;
      }
    }
    for (int j = i; j < N; j++) {
      if (S.at(j) == '.') {
        rightW++;
      }
    }
    ans = min(leftB + rightW, ans);
  }
  cout << ans << endl;
}
