#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, black = -1, count = 0, ans = INT_MAX, blackest = 0;
  int est = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++)
    if (S.at(i) == '#') blackest++;
  for (int i = 0; i <= N; i++) {
    for (int l = 0; l < i; l++) {
      if (S.at(l) == '#') count++;
    }
    count = 2 * count + N - i - blackest;
    ans = min(ans, count);
    count = 0;
  }
  cout << ans << endl;
}
