#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> op;
  for (int start = 0; start < n; start++) {
    string sharp = s.substr(start, n);
    string period = s.substr(0, start);
    int countb = 0;
    int countw = 0;
    for (char c : sharp) {
      if (c != '#') {
        countb++;
      }
    }
    for (char c : period) {
      if (c != '.') {
        countw++;
      }
    }
    op.push_back(countb + countw);
  }
  op.push_back(n - op.at(0));
  int ans = 10e8;
  for (int x : op) {
    ans = min(x, ans);
  }
  cout << ans << endl;
}
