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