#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N, cin >> S;
  int minchan = N;
  for (int sep = 0; sep < N; ++sep) {
    int chan = 0;
    for (int i = 0; i < N; ++i) {
      if (sep <= i) {
        if (S[i] != '#') ++chan;
      } else if (S[i] != '.')
        ++chan;
    }
    minchan = min(chan, minchan);
  }
  cout << minchan << endl;
  return 0;
}
