#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool flag = false;
  int ans = 99999999;
  int tmp_ans = 0;
  int ans2 = 0;
  string tmp = "#.";
  vector<int> point;
  for (int i = 0; i < (int)(n); i++)
    if (s[i] == tmp[0]) point.push_back(i);
  if (point.size() == 0) {
    cout << 0 << endl;
    return 0;
  }
  for (int aaa = 0; aaa < (int)(point.size()); aaa++) {
    tmp_ans = 0;
    int count = 0;
    flag = false;
    int d = point[aaa];
    for (int i = 0; i < (int)(n); i++) {
      if (flag) {
        if (s[i] != tmp[0]) tmp_ans++;
      } else {
        if (count == d && s[i] == tmp[0])
          flag = true;
        else {
          if (s[i] == tmp[0]) {
            count++;
            tmp_ans++;
          }
        }
      }
    }
    if (ans > tmp_ans) ans = tmp_ans;
    if (!flag) break;
  }
  cout << ans << endl;
}
